Need help with SQL Query

S

shripaldalal

Hi,

I have a table with four fields:


Group Under Group Primary Group
===== =========== ============
Sundry Debtors Current Assets Current Assets
North Sundry Debtors Current
Assets
UK North Current
Assets


So the group Highest Group is Current Assets -> Sundry Debtors ->
North -> UK
UK comes in North and North comes in Sundry Debtors.

Now if I want all Sundry Debtors groups I can run an SQL Query as:

select * from groupmaster where group = 'Sundry Debtors' or [Under
Group] = 'Sundry Debtors'

But this will only return Sundry Debtors and North but not UK.

How do i run a query that will return 'Sundry Debtors', North and UK
all three when I want all groups below Sundry Debtors.

Thanks,
Shripal Dalal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top