Same value Query?

admin

Administrator
Staff member
supose that we have a mysql table:

T1
________
ID |Val|
---|---+
1 | A |
2 | B |
3 | A |
4 | C |
5 | B |
-------+

we want to display The list of "ID" that have the same "val".
----

i know that one of the solution will be
select ID from T1 where val="A" and val="B"

but what if we have a large amount of data,

So how can we translate "same" to a sql query.

Thanx
 
Back
Top