gpt4 book ai didi

mysql - SQL查询返回重复行

转载 作者:行者123 更新时间:2023-11-29 13:34:06 24 4
gpt4 key购买 nike

请查找以下查询:

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

最佳答案

根据您显示的结果,简单的 DISTINCT 将删除重复项,因为列中的所有值在两行中都相同,

SELECT DISTINCT .....

关于mysql - SQL查询返回重复行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18988467/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com