Hello
How can I select rows having certain values in a field. For example
if I have the following row:
OBJ NUM
--- ---
AB 23
AB 24
AB 25
AC 26
AD 22
AD 23
AD 24
AD 25
AE 99
AE 20
AE 21
How can I only select the OBJ which have NUM(s): 23 and 24 and 25.
I tried using an ALL operator but that did not work.
The SQL I used to arrive at the above listing is:
SELECT DISTINCT OBJ, NUM
FROM OBJECTS
GROUP BY OBJ, NUM
HAVING OBJ_ON_HAND > 0
ORDER BY OBJ;
I tried using an ALL operator but that did not work:
SELECT DISTINCT OBJ, NUM
FROM OBJECTS
GROUP BY OBJ, NUM
HAVING OBJ_ON_HAND > 0
AND NUM = ALL(2003,2004,2005)
ORDER BY OBJ;
Thanks.
How can I select rows having certain values in a field. For example
if I have the following row:
OBJ NUM
--- ---
AB 23
AB 24
AB 25
AC 26
AD 22
AD 23
AD 24
AD 25
AE 99
AE 20
AE 21
How can I only select the OBJ which have NUM(s): 23 and 24 and 25.
I tried using an ALL operator but that did not work.
The SQL I used to arrive at the above listing is:
SELECT DISTINCT OBJ, NUM
FROM OBJECTS
GROUP BY OBJ, NUM
HAVING OBJ_ON_HAND > 0
ORDER BY OBJ;
I tried using an ALL operator but that did not work:
SELECT DISTINCT OBJ, NUM
FROM OBJECTS
GROUP BY OBJ, NUM
HAVING OBJ_ON_HAND > 0
AND NUM = ALL(2003,2004,2005)
ORDER BY OBJ;
Thanks.