sql - How to use case statement properly? How to use case statement with where or join table? -
I am trying to change the display value for all passwords 1 = 1 with name 1 and password 2 = 1 2 values in the database without the actual but when I executed the code, the system returned: I have the output: No Ryan, Lisa, 1, 3214, 1, 2, 5, 4, The output should me Name 1, Name 2, Gatecode, Password1, Password2, State Ryan, Lisa, 1, 3214, 4564, Florida Here's my code: I think this is what you want ... it's hard to say but you Must say in the right direction. You want in the selection statement in the case, where the statement is not.
Top 10 as the 'name1' Please, select g.name1 as' name2 ',' c.gatecode 'as gatecode, c.pas1 as' password1', c.pas2 as' password2 ', as g.state' State 's guest from left code CG Where to enter Gest_cdoe = c.guest_code when password 1 = 1 and g.guest_cdoe = C.guest_code then ba.bank_name1 WHEN password 2 = 2 and g.guest_cdoe = c.guest_code then ba.bank_name1 3 end order
Top 10 G Name 1 is named '1', g. In the form of name2, select 'name2', c.gateCode as gatecode when the case is C.pas1 = 1 and g.guest_cdoe = c.guest_code then g.name1 ELSE c.pas1 END, in case when c.pas2 = 1 and g.guest_cdoe = c.guest_code then g.name2 ELSE c.pas2 END, g. As a state, guest 'ji wa' code from C.G.Guide CDDO = C. Gwastcode sequence 3 to
Comments
Post a Comment