0
請看以下查詢:SQL查詢返回重複行
SELECT a.reco_index_content_code,a.reco_index_content_name, a.reco_index_user_action_download_file,
CASE WHEN b.refdata_profession_passion_code LIKE '%-%'
THEN 'passion'
ELSE 'profession'
END AS passion_or_profession
FROM tbl_reco_index_contents a
INNER JOIN tbl_reference_databases b
ON a.reco_index_content_code = b.refdata_content_code
WHERE a.reco_index_user_action_installed = 1 and a.user_profile_number = 1
查詢返回重複某些行。如果查詢不是自我解釋,我將不得不回覆更多細節。
任何幫助是非常讚賞的查詢
結果
AAY_AAYAB_FTD00028 PGA TOUR /mnt/sdcard/googleCheckout/PGA TOUR.apk profession
AAB_AABAE_FTD00071 PD Central /mnt/sdcard/googleCheckout/Parkinson's Central.apk passion
AAB_AABAE_FTD00071 PD Central /mnt/sdcard/googleCheckout/Parkinson's Central.apk passion
AAB_AABAE_FTD00072 com.diablo.psychiatry /mnt/sdcard/googleCheckout/Psychiatry-Neurology Pro.apk passion
AAB_AABAE_FTD00072 com.diablo.psychiatry /mnt/sdcard/googleCheckout/Psychiatry-Neurology Pro.apk passion
AAB_AABAA_FTD00074 Glasgow /mnt/sdcard/googleCheckout/Glasgow Coma Scale Free.apk passion
AAB_AABAA_FTD00073 FOUR Score /mnt/sdcard/googleCheckout/FOUR score.apk passion
AAB_AABAA_FTD00075 Qx Calculate /mnt/sdcard/googleCheckout/Calculate by QxMD.apk passion
你能顯示你的查詢結果嗎? –
用結果修改了我的問題 – user264953
如果連接表中有多個匹配'refdata_content_code'的行,就會發生這種情況。 – Barmar