473,698 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

newb join query

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
5 2379
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
"C L Humphreys" <cl*********@to ofgib.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
"Fletcher Arnold" <fl****@home.co m> wrote in message
news:bm******** **@titan.btinte rnet.com...
"C L Humphreys" <cl*********@to ofgib.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
"Peter Russell" <ru***@127.0.0. 1> wrote in message
news:me******** *************** @russellscott.b tinternet.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
"C L Humphreys" <cl*********@to ofgib.moc> wrote in message
news:bm******** **@ucsnew1.ncl. ac.uk...
"Fletcher Arnold" <fl****@home.co m> wrote in message
news:bm******** **@titan.btinte rnet.com...
"C L Humphreys" <cl*********@to ofgib.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11308
by: johnny | last post by:
How do I join two string variables? I want to do: download_dir + filename. download_dir=r'c:/download/' filename =r'log.txt' I want to get something like this: c:/download/log.txt
5
1318
by: Andrew Sackville-West | last post by:
Hi list, I've tried, lots of interpreter testing and google grepping to figure this out and I think I'm missing something fundamental. I have an ascii data dump from a POS system that has 131 fields in a single column in a flat file. I can easily open the file, read in the data and assemble it into various formats. okay. what I *want* to do is insert each of these fields into a mysql database that has 132 columns that correspond to...
2
1396
by: J | last post by:
Greetings Group- I'm trying to put together a pattern matching script that scans a directory tree for tif images contained in similar folder names, but running into a NewB problem already. Is it the way I'm trying to join multiple paths? Any help would be greatly appericated. Thanks, J! import glob, sys, os topdir = sys.argv
2
1064
by: johnny | last post by:
Scope of ids: When I print "ids", it's always empty string '', as I have intialized before. That's not what I want. I want the ids to have str(r).join(',') if res: ids = '' for r in res: ids = str(r).join(',')
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7738
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.