I have a table 'members' with these rows: 'id' , 'name'
I have about 20000 records in this table
I have a table 'members_info' with these rows: 'member_id' , 'info1',
'info2', ...
I have about 200 records in this table.
I have:
SELECT DISTINCT members.*, members_info.* FROM members JOIN members_info ON
id=member_id;
many members in table 'members' have extra information (1 record of table
'members_info') but most of users haven't (0 records of table
'members_info')
I want to see *all* members.
If a member have extra info I want to see extra info in "members_info.* ".
If a member haven't extra info I want to see NULL in "members_info.* ".
But with query above I see only the members *with* extra info with their
extra infos.
Can you give my the correct query?
I am newbie in SQL world.
Please help!
I have about 20000 records in this table
I have a table 'members_info' with these rows: 'member_id' , 'info1',
'info2', ...
I have about 200 records in this table.
I have:
SELECT DISTINCT members.*, members_info.* FROM members JOIN members_info ON
id=member_id;
many members in table 'members' have extra information (1 record of table
'members_info') but most of users haven't (0 records of table
'members_info')
I want to see *all* members.
If a member have extra info I want to see extra info in "members_info.* ".
If a member haven't extra info I want to see NULL in "members_info.* ".
But with query above I see only the members *with* extra info with their
extra infos.
Can you give my the correct query?
I am newbie in SQL world.
Please help!