in a previous question I asked how to return id’s from 3 different tables if the user_id was matched to a record in each of these tables. the sql-
select
(select id from bla_facebook_accts where user_id = user.user_id) as facebook,
(select id from bla_linked_in_accts where user_id = user.user_id) as linkedin,
(select id from bla_twitter_accts where user_id = user.user_id) as twitter
from
(select 12 user_id) user
Works great, but I would like each the select statements that return a whether or not each of the tables has a record to return a new row, and return multiple rows if a table has more than one record for each .
Here you go. This will also return the source table of the information.