kev510
Programmer
- Jul 12, 2006
- 61
Hello everyone.
Let me first say that I'm very new with SQL, and I believe there is an easy way to go about the problem I'm having, but it's just not clicking into my head.
I have Table1 and Table44.
Both table contain data that I would like to display as one table in a webpage. The tables would be matched by values in the columns called "SampleNo". Table1 has MOST of the data I need (SampleNo, SampleTitle) to display, but I have to bring over a column named "SamplePG" from Table44.
Problem I'm having is that ONLY records that are SamplePG = 1 exist in Table44. So when I match SampleNo in Table1 and Table44, my query only displays 4 records because there are only 4 (SamplePG = 1) records in Table44.
Here's what I need it to do - I have to display ALL RECORDS from Table1, but whatever DOES exist in Table44 (matching by SampleNo in Table1/Table44), I have to display SamplePG = 1, otherwise display SamplePG = 0.
Sorry if my explaination is hard to understand, but I tried my best. If you have questions, please let me know as I'll be standing by the computer.
Thanks for your time!
Let me first say that I'm very new with SQL, and I believe there is an easy way to go about the problem I'm having, but it's just not clicking into my head.
I have Table1 and Table44.
Both table contain data that I would like to display as one table in a webpage. The tables would be matched by values in the columns called "SampleNo". Table1 has MOST of the data I need (SampleNo, SampleTitle) to display, but I have to bring over a column named "SamplePG" from Table44.
Problem I'm having is that ONLY records that are SamplePG = 1 exist in Table44. So when I match SampleNo in Table1 and Table44, my query only displays 4 records because there are only 4 (SamplePG = 1) records in Table44.
Here's what I need it to do - I have to display ALL RECORDS from Table1, but whatever DOES exist in Table44 (matching by SampleNo in Table1/Table44), I have to display SamplePG = 1, otherwise display SamplePG = 0.
Sorry if my explaination is hard to understand, but I tried my best. If you have questions, please let me know as I'll be standing by the computer.
Thanks for your time!