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

Querying Same Table Twice in the same query

Status
Not open for further replies.

beridor

MIS
Aug 8, 2003
26
0
0
GB
Hi Guys,

I have a table that consists of: -

ModuleID Int
PortID VARChar
Quantity Int

It is a linking table which links an individual module which may have ports of different types (or not) to a description of the ports. So for example a module might be: -

Module 1 has 4x(10/100 RJ45 Ports) and also 4x(MTRJ ports.)
Module 2 has 4x(10/100 RJ45 ports) and also 2x(SC ports).
Module 3 has 8x(10/100 RJ45 ports)

so the entries in the table would look something like: -

ModuleID PortID Quantity
1 RJ 4
1 MT 4
2 RJ 4
2 SC 2
3 RJ 8

I want to be able to query this table to find all ModuleIDs that have more than 2 RJ ports and also more than 3 MT ports.

Has any one any suggestions?
 
Use the AS clause to refer to the same table with a different name.
 
Thanks for the fast reesponse DonQuichote, I had tried that but it looks as if there might be a slight bug in NaviCat and it wasn't doing quite what I thought it was. All working now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top