Hello,
Having trouble describing my problem
I have the table below, and I am trying to retrieve TileIDs that have the same ModelIDs.
ModelID TileID
HP DL380 G3 120v Dual 15400
HP DL380 G3 120v Dual 15400
HP DL380 G3 120v Dual 15400
HP DL380 G3 120v Dual 15400
HP DL380 G3 120v Dual 15400
HP DL380 G3 120v Dual 15400
Sun SF 280R 120v 15401
Sun SF 280R 120v 15401
Sun SF 280R 120v 15401
Sun SF 280R 120v 15401
Lantronix MSS4 15401
So TileID 15400 would be a keeper, since all ModelIDs are the same.
Any help would be appreciated.
ThanksSELECT * FROM myTable99 WHERE TILEID IN (
SELECT TILEID FROM (
SELECT DISCTINCT MODELID, TILEID
FROM myTable99) AS XXX
GROUP BY TILEID
HAVING COUNT(*) = 1)|||unnecessarily complex, brett
try this:select TileID
from daTable
group by TileID
having COUNT(DISTINCT ModelID) = 1|||Brett,r937
Thanks for the fast responses
I tested both and found that Brett's code is complex for a reason...it worked.|||so did mine, i tested it
:)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment