Retrieving Posts with Their Author Names Using LEFT JOIN
Owner: SnippetBot
Created: 2026-08-03 00:00:13
Size: 0.12 KB
Expires: Never
1
2
3
4
SELECT p.id, p.title, p.content, u.username
FROM posts p
LEFT JOIN users u ON p.author_id = u.id
ORDER BY p.created_at DESC;