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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! WHERE clause problem!

Status
Not open for further replies.

thepez

Programmer
Sep 4, 2002
2
CA
I've been pulling my hair out trying to figure out this SQL query, maybe some of you experts can figure it out.

Table (tires) Fields
--------------------
tireid (primary key)
tire1 (number)
tire2 (number)
tire3 (number)
tire4 (number)

My Query
--------
SELECT *
FROM tires
WHERE tire1 >= 10
OR tire2 >= 10
OR tire3 >= 10
OR tire4 >= 10

Basically as you can see I am just trying to return any records if any of the tire fields are >= 10 .. The problem is I get an insane amount of rows returned. Any ideas?
 
Not sure I see the problem. How many rows are there in the table? Does it return the correct rows? How many rows would you expect it to return?

Greg.
 
Well there are only 5 records and it is returning hundreds. :(
 
<thepez>
Hi there,
Are you saying that if you do:
Select * From TIRES
then only five records are returned,
but if you run your query as described above, then hundreds of records are returned?
 
It's got me stumped anyway :) I'll have another think.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top