Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
seanb
Starting Member
1 Post |
Posted - 2008-05-21 : 19:07:39
|
I'm having issues pulling the wrong data so I thought I would ask you guys for some help. This sql is supposed to be displaying the records where either the account hasn't set a credit card or a address. I know I must have messed something up because pulling out the where returns the wrong data (there are no accounts with no address or card number being shown). Heres the query below:SELECT * FROM MEMBER mRIGHT OUTER JOIN MEMBER_LOCATION m1 on m.MEMBERID = m1.MEMBERIDRIGHT OUTER JOIN LOCATION l1 on m1.LOCATIONID = l1.LOCATIONIDINNER JOIN ACCOUNT a1 on m.CUSTOMERID = a1.CUSTOMERIDRIGHT OUTER JOIN CREDIT_CARD cc on a1.ACCOUNTID = cc.ACCOUNTIDWHERE (ml.STREET = '' OR cc.CARD_NUMBER = '') |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-05-21 : 19:18:15
|
Could you show us a data example of what you mean? What is your query currently showing? What is it supposed to show? What does the data in the tables look like?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Database maintenance routines:http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx |
 |
|
|
|
|