Question about a query
Question about a query
(OP)
Hello all, I was wondering how do to something. I have a table that I need to do some kind of sub query. I am learning so this query eill teach me a lot. I have 2 columns One is the ID and the other is Num. I need to search for all Nums that have a "0" in it and get the ID of that row. I then need to search in the column "Num" and get match the row id. I think this would be an embedded search (something like that).
Here is my columns.
I will attempt the query string:
Something like that. I want to learn how to do this kind of search.
Thanks,
timgerr
Here is my columns.
CODE
ID Num
2 0
3 2
4 2
2 0
3 2
4 2
CODE
select Num from table where Num = (select ID from Num where Num = 0 )
Thanks,
timgerr
-How important does a person have to be before they are considered assassinated instead of just murdered?
Congratulations!
RE: Question about a query
from table a
inner join table b
on a.id = b.num
where a.num = 0
NOT TESTED!!!
RE: Question about a query
I guess you meant this:
CODE
Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?
RE: Question about a query
in this case the sub query should result a single ID.(according to query)
select ID from table where Num IN (select ID from table where Num = 0 )
in this case the sub query should result multiple IDs.
(So it works fine)