Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query help

Status
Not open for further replies.

teroy

Programmer
Oct 17, 2000
67
AU
Hi Guys,
i have the following sql statement

SELECT c.id, c.name, c.username, c.email
FROM customer c, rgheader r, custrate cu
WHERE 0 = 0
AND NOT tech_record = 1
AND cu.custid = c.id
AND cu.rgid = r.id
AND r.id = 200

Now this works okay....but if i want to modify the last line like this

AND (r.id = 200 or r.id = 190)

i get a timeout error. I guess the code i'm trying to produce is inefficient/incorrect. Does anyone have any ideas on how i can rewrite this.

Thanks in advance
 
sorry guys..my bad..i restructured the query and it works fine

SELECT c.id, c.name, c.username, c.email
FROM customer c, rgheader r, custrate cu
WHERE 0 = 0 AND cu.custid = c.id AND cu.rgid = r.id AND
(r.id = 200 OR
r.id = 180) AND (NOT c.tech_record = 1)


Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top