SELECT
MAX(COMB_1) AS COMB_1,
MAX(COMB_2) AS COMB_2,
MAX(COMB_3) AS COMB_3,
MAX(CATEGORY) AS CATEGORY,
COUNT(*) AS PARTNER_COUNT
FROM NoOneNamesTheirTableInSQLQuestions
GROUP BY CONCAT_WS(';', COMB_1, COMB_2, COMB_3);
This uses a MySQL function CONCAT_WS()
, but there should be equivalent ways of doing this in each of the other databases you tagged your question: Oracle and SQLite.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.