1. 程式人生 > >在select子句裡如何實現另一個select語句的查詢|在select子句裡用逗號隔開的每個項的本質是一個表示式

在select子句裡如何實現另一個select語句的查詢|在select子句裡用逗號隔開的每個項的本質是一個表示式

select

case when lock_purpost in(SELECT id from data_dictionary) then (SELECT name from data_dictionary where id=lock_purpost)  else lock_purpost end as lock_purpost(別名),

case when lock_framework in(SELECT id from data_dictionary) then (SELECT name from data_dictionary where id=lock_framework) else lock_framework end as lock_framework

from v_photosum_attach ;

註釋: