Jump to content

union select. different amount of rows


Jaynesh

Recommended Posts

Hello

 

Ok, i've done that but it isnt working.

 

SELECT DISTINCT dbPosts.post
FROM dbPosts

LEFT JOIN ( dbUsers, dbFriends )
ON (
dbPosts.username_id = dbUsers.id
AND (dbPosts.username_id = dbFriends.user_id)
OR
(dbPosts.username_id = dbFriends.friend_id))

LEFT JOIN (dbUsers, dbPosts_share, dbFriends)
ON (
dbPosts.username_id = dbUsers.id
AND 
(dbPosts.post_id = dbPosts_share.post_id)
OR 
(dbPosts.username_id = dbPosts_share.user_id)
AND
(dbPosts_share.user_id = dbFriends.friend_id)
OR 
(dbPosts_share.user_id = dbFriends.user_id))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.