Gossamer Forum
Home : General : Databases and SQL :

Nesting question

Quote Reply
Nesting question
Hello everybody, I am writing two sql queries and having trouble connecting them together....

My first sql is
---------------------------------------

Select A.License_Number
From Auto A, Tire T
Where A.License_Number = T.License_Number
Group By A.License_Number, T.Current_Tire_Position
Having Count(*) >= 2
Order By A.License_Number;

This will give the answer:

License_Number
5OEC140


My second sql is
---------------------------------------
Select Count(T.Tire_Number)
From Auto A, Tire T
Where A.License_Number = T.License_Number
AND A.License_Number = '5OEC140';

This will give the answer:

Count(T.Tire_Number)
4


What i want to do is to use nesting to combine these two queries together to produce the following result:

License_Number
5OEC140
Count(T.Tire_Number
4

Please advise what to do. Thanks alot for helping.
Subject Author Views Date
Thread Nesting question ryan_ng3 6925 May 27, 2003, 9:29 AM
Post Re: [ryan_ng3] Nesting question
brose 6626 May 29, 2003, 8:29 PM
Post Re: [ryan_ng3] Nesting question
Netmos 6508 Jul 7, 2003, 5:51 AM