473,320 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

question on query

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!
Jul 19 '05 #1
4 1596
SELECT members.*, members_info.*
FROM members
OUTER LEFT JOIN members_info ON members.id = members_info.member_id ;

Lukas
Jul 19 '05 #2
SELECT members.*, members_info.*
FROM members
OUTER LEFT JOIN members_info ON members.id = members_info.member_id ;

Lukas
Jul 19 '05 #3
SELECT members.*, members_info.*
FROM members
left outer join members_info ON members.id = members_info.member_id ;

Lukas
Jul 19 '05 #4
SELECT members.*, members_info.*
FROM members
left outer join members_info ON members.id = members_info.member_id ;

Lukas
Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
2
by: Test User | last post by:
Hi all, (please excuse the crosspost as I'm trying to reach as many people as possible) I am somewhat familiar with Access 2000, but my latest project has me stumped. So, I defer to you...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
2
by: Tom | last post by:
This is related to an earlier post entitled "Text in Query/Numbers in Report" Brief recap - report has a query as a record source. The query shows the correct data, the report translating the...
3
by: cover | last post by:
I have a table with 50 fields that receive input depending on whether that input came in from a 'shaker' form or a 'conveyor' form. Input from the 'conveyor' form might populate 25 fields while...
5
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored...
0
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
14
by: Ralf Rottmann \(www.24100.net\) | last post by:
I recently stumbled across a pretty interesting LINQ to SQL question and wonder, whether anybody might have an answer. (I'm doing quite some increasing LINQ evangelism down here in Germany.). ...
2
by: Jeff | last post by:
I have an increasingly-complicated query string that sends results to an Excel file; I've broken the query somehow. Currently using Access 2007, DAO recordset via late binding (we don't have...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.