Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compare 2 result sets without INTERSECT

I have 2 tables :-

ITEM(ITEM_ID, ITEM_NAME)

STATS(ITEM_ID, STAT_ID, STAT_VALUE)

I would like to return the ITEM_IDs with exactly the same STATS, but it is on SQL Server Compact(no EXCEPT or INTERSECT)

For example :

STATS:-
1 12 100 
1 13 500
2 12 200
2 14 300
3 12 100
3 13 500
4 12 100

Should returns the lines for 1 and 3 (same stats/values 12/100 and 13/500)

Is it possible without INTERSECT?

like image 423
Castorix Avatar asked Dec 09 '22 03:12

Castorix


1 Answers

use inner join in ITEM table and use on condition for whatever you want to see on that table

like image 110
Gin Uchiha Avatar answered Dec 21 '22 23:12

Gin Uchiha