Groups | Blog | Home
all groups > sql server (alternate) > january 2004 >

sql server (alternate) : Filtered out code


Sam G
1/7/2004 5:59:28 PM
Hi all,
I’m a bit new to this so hope this is not too obvious!
I am running a query like so (simplified form)
Select Cus_no, Cust_Name, course_id
Where Cust_id = 2
From course table
However not all the Cust_Id’s have been entered therefore so using a two
filters out the information I might need.
Is there a way I can get around this?
Many thanks
Sam


*** Sent via Developersdex http://www.developersdex.com ***
Simon Hayes
1/7/2004 7:12:27 PM

[quoted text, click to view]

It's not completely clear from your description what your issue is - do you
want to ignore the WHERE clause? If so, just remove it or comment it out:

SELECT Cus_no, Cust_Name, course_id
FROM Course_Table
/* WHERE Cust_id = 2 */

If that doesn't help, perhaps you could provide some more details,
especially which version of MSSQL you're using, and which client tool (Query
Analyzer, VB code, etc.), as well as what you expect to see when you run the
query.

Simon

Greg D. Moore (Strider)
1/8/2004 12:57:54 AM

[quoted text, click to view]

Sounds like you might want

select Cus_no, Cust_Name, course_id where Cust_id=2 or Cust_id is NULL


[quoted text, click to view]

AddThis Social Bookmark Button