一个sql问题研究
SELECT NAME FROM TEMP_TEST WHERE HOBBY = 'basketball' OR HOBBY = 'badminton' GROUP BY NAME HAVING COUNT(*) >= 2;
SELECT NAME FROM TEMP_TEST WHERE HOBBY = 'basketball' OR HOBBY = 'badminton' GROUP BY NAME HAVING COUNT(*) >= 2;
这种前提是没有考虑数据量的操作,如果数据量太大,效率提示还是要通过临时表~