0
我想選擇所有Out_No
其中這個條件does not exist
如何選擇,如果條件不存在
(event_type = 'COMMENT_CHANGE' and COMMENTS LIKE 'Cause:%')
樣本查詢
select
Out_no
from TableA
Where Out_no > '12345'
我想選擇所有Out_No
其中這個條件does not exist
如何選擇,如果條件不存在
(event_type = 'COMMENT_CHANGE' and COMMENTS LIKE 'Cause:%')
樣本查詢
select
Out_no
from TableA
Where Out_no > '12345'
我結束了使用的答案從this question。
select out_no,
from TableA
where out_no > '12345'
and out_no not in
(select
out_no
from TableA
where event_type = 'Comment_change'
and comments like 'Cause%'
)
Order by out_no desc
希望它可以幫助別人。