By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,222 Members | 1,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,222 IT Pros & Developers. It's quick & easy.

newb join query

P: n/a
Hi,

When performing a large join, say on personaldetails against various other
tables where there is a one to many relationship, obviously the first table
will be repeated many times with the other's varying details.

I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).

Can this be done easily with sql?

Cheers,
Chris
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In principle you want to create GroupBy queries for your 'many' tables and
join these to the main table.
It is possible to do this in one sql statement but you may a massive
amount of sql code to handle.
I would be inclined to build saved queries for the groups and then treat
these as source table for a final query.
Regards

Peter Russell
C L Humphreys previously wrote:
Hi,

When performing a large join, say on personaldetails against various
other
tables where there is a one to many relationship, obviously the first
table
will be repeated many times with the other's varying details.

I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).

Can this be done easily with sql?

Cheers,
Chris


Nov 12 '05 #2

P: n/a
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bm**********@ucsnew1.ncl.ac.uk...
Hi,

When performing a large join, say on personaldetails against various other
tables where there is a one to many relationship, obviously the first table will be repeated many times with the other's varying details.

I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).

Can this be done easily with sql?

Cheers,
Chris


....to be shown...? Where? On the screen you might use a form/subform
whereas on paper you could use either a report/subreport or a single report
with grouping. Any reason why you specifically wanted a query to do this?

Fletcher
Nov 12 '05 #3

P: n/a
"Fletcher Arnold" <fl****@home.com> wrote in message
news:bm**********@titan.btinternet.com...
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bm**********@ucsnew1.ncl.ac.uk...
When performing a large join, say on personaldetails against various other tables where there is a one to many relationship, obviously the first table
will be repeated many times with the other's varying details.
I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).

...to be shown...? Where? On the screen you might use a form/subform
whereas on paper you could use either a report/subreport or a single report with grouping. Any reason why you specifically wanted a query to do this?


Shown on screen, as a query. I just need the details of one table and a
segment of their involvement in other tables.

Chris
Nov 12 '05 #4

P: n/a
"Peter Russell" <ru***@127.0.0.1> wrote in message
news:me***********************@russellscott.btinte rnet.com...
C L Humphreys previously wrote:
When performing a large join, say on personaldetails against various
other
tables where there is a one to many relationship, obviously the first
table
will be repeated many times with the other's varying details.
I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).
In principle you want to create GroupBy queries for your 'many' tables and
join these to the main table.
It is possible to do this in one sql statement but you may a massive
amount of sql code to handle.
I would be inclined to build saved queries for the groups and then treat
these as source table for a final query.


Thanks for that, sounds do-able :o)
Chris
Nov 12 '05 #5

P: n/a
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bm**********@ucsnew1.ncl.ac.uk...
"Fletcher Arnold" <fl****@home.com> wrote in message
news:bm**********@titan.btinternet.com...
"C L Humphreys" <cl*********@toofgib.moc> wrote in message
news:bm**********@ucsnew1.ncl.ac.uk...
When performing a large join, say on personaldetails against various other tables where there is a one to many relationship, obviously the first table
will be repeated many times with the other's varying details.
I only want one occurence of the other tables to be shown (so every
personaldetails, but just any (random is ok) address/order/etc/).

...to be shown...? Where? On the screen you might use a form/subform
whereas on paper you could use either a report/subreport or a single

report
with grouping. Any reason why you specifically wanted a query to do

this?
Shown on screen, as a query. I just need the details of one table and a
segment of their involvement in other tables.

Chris

Then unless there is a sensible reason not to, I would use a form/subform
combination. Not only is it easier to do in this case, but is so much more
flexible because of the form's additional properties and methods. There's
not much you can do with a query.

Fletcher
Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.