我有這個疑問MySQL的左連接空結果
SELECT articles.*,
users.username AS `user`
FROM `articles`
LEFT JOIN `users` ON articles.user_id = users.id
ORDER BY articles.timestamp
基本上它返回的文章列表,並將本條關聯到的用戶名。現在,如果用戶表中沒有特定用戶標識的條目,則users
var爲NULL。無論如何要做到這一點,如果它的null返回類似「未找到用戶」?或者我將不得不這樣做使用PHP?
GOTA等待8分鐘接受...:P上的用戶 – Ozzy 2010-05-24 00:20:04