嘿,我想從表中得到幾個datarows。但不想讓這些公司翻倍。所以我想用DISTINCT條款來減少公司。是這樣的可能嗎?WHERE公司=(DISTINCT公司)
SELECT Company, Firstname, Surname, eMail, Adress, Place, Phone, Fax FROM `contact_list`
WHERE Company = (DISTINCT Company as `compName`)
FROM:
Company | Firstname | Surname | eMail | Adress | Place | Phone | Fax
DELL | Max | Master | [email protected] | dellstreet | chicago | 543478 | 543267
DELL | John | Doe | [email protected] | dellstreet | chicago | 543462 | 543267
SHELL | Charlie | Fame | [email protected] | nicestreet | shelltown | 5546546 | 54535
期待:
Company | Firstname | Surname | eMail | Adress | Place | Phone | Fax
DELL | Max | Master | [email protected] | dellstreet | chicago | 543478 | 543267
SHELL | Charlie | Fame | [email protected] | nicestreet | shelltown | 5546546 | 54535
請提供一些示例數據和預期輸出。 – Wanderer
然後更改標題.. – Wanderer
第1列和第10列包含什麼? –