Re: need help using table multiple times within select
Posted in 1999
>I hope someone out here can help me.
>I am writing a bill of materials report. We have 1 file that has
>the parent and component. What I need to do is to keep reading the
>file matching the component to an alias parent to see if it has
components.
>Where I am having problems is when I reach a level where the
component
>is not a parent. The query will not return a match. I know that there
has
>to be a way to do a join so that it will return a null if the
component is
>not there.
>Anyone have any ideas?
Use an outer join? Something like:
SELECT a.colx, b.colx
FROM tab a, OUTER tab b
WHERE a.colx = b.colx
Or something like that. This should give you something like:
a.colx b.colx
1 1
2 2
3
4 4
...
(where 3 is obviously one of the records you're trying to find)
HTH.
--
"I'll Be Back"
Obnoxio
************************************************
Sane? Hell, if I was sane, why would I be here?
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com