對不起,打擾你,但我有一個工會問題的問題;我試圖實現我在其他文章中閱讀的相同邏輯,但它不適合我,請幫助一下?SQL查詢 - 選擇的工會數
這是我的代碼: /數據聲明?
/*where i should make the count*/
/*first select*/
UNION
/*second select*/
/*in the where of the second select I have a case with the following data*/
CASE
WHEN ((@case='other') AND (cfv.value like '%,' + cast (@today as VARCHAR) or cfv.value like '%' + cast (@today as VARCHAR)
or cfv.value like '%' + cast (@today as VARCHAR)+',0'
or cfv.value like '%' + cast (@today as VARCHAR)+',0,1'
or cfv.value like '%' + cast (@today as VARCHAR)+',1'))
then 1
WHEN ((@case ='zero') AND(cfv.value='0')) THEN 1
WHEN ((@case ='one') AND(cfv.value='1' or cfv.value='0,1')) THEN 1
ELSE 0
END = 1
,並沒有指望,所以我想這應該是很容易的,但我不明白這種重結果:S Just a column of elements but I'd like to have the number of the element present in this case 2
感謝這麼多提前
太多的代碼,沒有足夠的解釋什麼問題是什麼,你的預期輸出應該是什麼。請編輯你的問題。 – PyNoob