Home > Net >  Ask: the problem of SQL statement condition judgment
Ask: the problem of SQL statement condition judgment

Time:09-16

There are fields in table test A, B

Now request is to use SQL query, if B=1, it returns A list of the actual number, if B=0, it returns A column=0

If there is no other code, just pure SQL statements, can achieve?

CodePudding user response:

Every time just after I found the answer

The case then

CodePudding user response:

reference 1/f, Tiny ~ reply:
every time just after I found the answer

The case then


Wrong, case when

Can't I is the primary query

CodePudding user response:

Own a post, the more the better, to strengthen the construction of community,

CodePudding user response:

 case when then end 
 decode 
is ok
  • Related