November 10, 2005 at 11:26 pm
I'm having trouble getting this to return the correct result.
It returns any and all rows that match the OR conditions
SELECT * FROM tableA
WHERE
FullName = 1
OR MailingAddress = 1
OR Phone = 1
OR Fax = 1
OR Email = 1
AND ListingID = 10
I understand why it returns the other rows, but I cannot figure out how to only return the desired row.
Any help would be appreciated
Thanks in advance
Rick
November 11, 2005 at 12:09 am
is your conditions :
- ListingID equal to 10
- FullName = 1 OR MailingAddress = 1 OR Phone = 1 OR Fax = 1 OR Email = 1
then the OR should be place in '(' and ')'
SELECT * FROM tableA
WHERE ( FullName = 1
OR MailingAddress = 1
OR Phone = 1
OR Fax = 1
OR Email = 1
)
AND ListingID = 10
November 11, 2005 at 1:32 pm
KH,
Thanks for the answer,
I'll know for next time as I should be using some more of these down the road
Thanks again
Rick
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy