sql查询报错:
not a Selected expression:不是一个查询表达式;
这个错误主要是使用distinct后出现的,通常出现在通常distinct和order by 一起使用的情况
sql如下:
SELECT tab.*
FROM (
SELECT DISTINCT a.offer_id AS offer_id,
a.offer_name,
a.offer_sys_name,
a.offer_type offer_kind,
CASE (
SELECT lab.label_id
FROM OBJECT_LABEL_REL olr
INNER JOIN label lab on olr.LABEL_ID = lab.LABEL_ID
WHERE a.offer_id = olr.obj_id
AND olr.label_id IN ('10000', '10001')
)
WHEN 10000 THEN
&#