November 6, 2008 at 11:52 am
Hello
I am trying to retrieve all records where there is only a value in the T_Customers.Postcode with the following query, but it doesn't give me the right result, can anyone help?
SELECT T_Customers.CustomerID, T_Customers.CustTypeID, T_Customers.Surname, T_Customers.Forename, T_Customers.TitleID, T_Customers.Ref1,
T_Customers.Add1, T_Customers.Add2, T_Customers.Add3, T_Customers.Add4, T_Customers.County, T_Customers.Postcode
FROM T_Customers
WHERE exists ( select * from T_Customers where T_Customers.Postcode ='');
November 6, 2008 at 12:20 pm
Can you just do a simple where clause as follows or was there a reason for the EXISTS() use?
SELECT T_Customers.CustomerID, T_Customers.CustTypeID, T_Customers.Surname, T_Customers.Forename, T_Customers.TitleID, T_Customers.Ref1,
T_Customers.Add1, T_Customers.Add2, T_Customers.Add3, T_Customers.Add4, T_Customers.County, T_Customers.Postcode
FROM T_Customers
WHERE T_Customers.Postcode ='';
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply