选择带有if语句结果的语句

时间:2017-10-03 18:33:30

标签: mysql

我使用下面的命令来实现以下算法方案

select columnA,
if ((select column from table2 where somecolumn ="A") = "colA")
 as bins from table1

算法:

select 
 [if value of (select column value = A) == "A"
then select column B
else select column B]
from table1

不确定我在上述查询中出错的地方。有人会帮我这个!!

0 个答案:

没有答案