刪除重複如何選擇唯一行只有3個:這樣SQL查詢 - 我需要從查詢
63518 | 3 | 338 | 338 - Turks and .... | 0.0245 |
63519 | 3 | 338 | 338 - Jamica | 0.0235 |
63522 | 3 | 338 | 338 - Haiti | 0.0285 |
SELECT
r.id,
r.client_id,
mcc.mcc AS mcc,
CONCAT(mcc.mcc, " - ", mcc.country_name) AS mcc_text,
r.rate,
mcc.dial_code,
r.active
FROM rates r
INNER JOIN clients c
ON c.id = r.client_id
INNER JOIN mcc
ON mcc.mcc = r.mcc
WHERE r.client_id = 3 AND r.mcc = 338 AND r.mnc = 50 AND r.active = 1
我試圖用 .... GROUP BY r.id 但mcc_text是錯誤的
使用組由ID後where子句結束 – Abhishekkumar
@Abhishekkumar,我加入PIC,它不worki(( – AxOn
@ shawnt00,我不明白,如意集團是mcc_text = dial_code = id – AxOn