我想做這個查詢:MySQL查詢鮮明+多
SELECT *
FROM user k
INNER JOIN (
SELECT id, tagName, b.guid, name, owner, publicKey
FROM noteTags a
INNER JOIN (
SELECT *
FROM note
ORDER BY guid
LIMIT 0 , 12
)b ON a.guid = b.guid ORDER BY b.id DESC
)l ON k.owner = l.owner
但我想它返回DISTINCT b.guids。表的
結構:
note
|
|=id
|=name
|=guid
|=owner
|=publicKey
noteTags
|
|=guid
|=tagName
user
|
|=owner
|=username
|=auth
基本上我想選擇所有的數據(與更深內加入限制),並返回不同的GUID
謝謝!
這是一個例子,如果有兩個記錄具有相同的圖形用戶界面,下列哪一個會顯示爲'GUI = 1,Colname = 1'或'GUI = 1,Colname = 2'? –
並不重要,兩者的值都相同 –
所以只要只顯示1個GUI,就表示以下任何一項。 –