| |

VerySource

 Forgot password?
 Register
Search
View: 725|Reply: 4

Can the IF statement change the output order of the columns in the comparison select

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-24 11:00:01
| Show all posts |Read mode
Hope to output select A.B.C.D-(if B value> C value)
             else select A.C.B.D-(if C> B)
Reply

Use magic Report

0

Threads

100

Posts

53.00

Credits

Newbie

Rank: 1

Credits
53.00

 China

Post time: 2020-2-10 15:00:01
| Show all posts
Judge by case
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-3-10 13:30:01
| Show all posts
Can you give an example?
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-4-16 22:15:01
| Show all posts
Go up first ...
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 China

Post time: 2020-4-19 11:00:02
| Show all posts
select A,
(case when B value> C value then B ELSE C END) AS B,
(case when B value> C value then C ELSE B END) AS C, D FROM ..
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list