In Access, case when then else end does not support switch instead. caseswitch

Source: Internet
Author: User

In Access, case when then else end does not support switch instead. caseswitch

In Access, case when then else end cannot be replaced by switch.

Here, we mainly implement multiple fields in a table, compare multiple fields, and obtain the maximum or minimum values for processing.

Case when then else end example

<span style="font-family:Microsoft YaHei;font-size:14px;">selece f1,f2,(case when f1>f2 then f1 else f2 end) as a from table</span>


But it is found that access is not easy to make

Next, replace the following with the switch supported by access:

<Span style = "font-family: Microsoft YaHei; font-size: 14px;"> select * from (select topvalue, bottomvalue, leftvalue, rightvalue, switch (a> B, a, a <= B, B) as result from (select topvalue, bottomvalue, leftvalue, rightvalue, switch (topvalue> bottomvalue, topvalue, topvalue <= bottomvalue, bottomvalue) as, switch (leftvalue> rightvalue, leftvalue, leftvalue <= rightvalue, rightvalue) as B from imageh Andle) order by result desc query results:  </ span>
Record it here, haha

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.