简体   繁体   中英

How to use a select statment inside a case statement

I will do a select statement inside my case statement like this:

CASE
    WHEN d.dependent_speed_type = 4 THEN (SELECT column FROM tablename) 
END

But this is not working. Can I realize a select statement inside my case statement? If the value 4 is inside my column "d.dependent_speed_type" then it should be select a special value from another table. How is the right syntax?

您必须使用总是返回一个值的东西,例如SELECT MAX(column) FROM tablename)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM