select a, b, c, d, e, f
from table
where f = 1006 or f = 196
or, if you want to only display rows that have both values for one value in A (225 and 226 in example), this:
Code:
select a, b, c, d, e, f
from leTable t
inner join
(
select a from
(
select a from leTable where f = 1006
) x
inner join
(
select a from leTable where f = 196
) z
on x.a = z.a
) s
on t.a = s.a
You could also use IN for this, but I try to avoid use of IN when possible.
HOpe this helps,
Alex
Hope this helps,
Alex
Ignorance of certain subjects is a great part of wisdom
What about this ?
SELECT D.a, D.b, D.c, D.d, D.e, D.f
FROM yourTable D INNER JOIN (
SELECT a FROM yourTable WHERE f IN(1006,96) GROUP BY a HAVING COUNT(*)=2
) G ON D.a = G.a
WHERE D.f IN(1006,96)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.