Re: 30 tables I need the Same 5 fields from wach of them!!!
From: Brendan Reynolds (brenreyn)
Date: 01/06/05
- Next message: Brendan Reynolds: "Re: How would my database write a number with letters?"
- Previous message: shanem: "Can a query return a result greater than 255 characters?"
- In reply to: Matt_Fairfield: "30 tables I need the Same 5 fields from wach of them!!!"
- Next in thread: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Reply: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Reply: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 Jan 2005 13:55:22 -0000
You need a union query ...
SELECT Field1, Field2 FROM FirstTable
UNION SELECT Field1, Field2 FROM SecondTable
etc., etc., etc.
If the table names are numbered, something like Table1, Table2, Table3 etc.,
it might be possible to write some code to build the SQL statement, and it
might be a little faster, or at least a little less tedious, than typing 30
SELECT statements.
Do you need me to tell you that this is not a good database design?
-- Brendan Reynolds (MVP) http://brenreyn.blogspot.com The spammers and script-kiddies have succeeded in making it impossible for me to use a real e-mail address in public newsgroups. E-mail replies to this post will be deleted without being read. Any e-mail claiming to be from brenreyn at indigo dot ie that is not digitally signed by me with a GlobalSign digital certificate is a forgery and should be deleted without being read. Follow-up questions should in general be posted to the newsgroup, but if you have a good reason to send me e-mail, you'll find a useable e-mail address at the URL above. "Matt_Fairfield" <MattFairfield@discussions.microsoft.com> wrote in message news:A55F0E42-313A-40BA-A706-600445293004@microsoft.com... >I have 30 different tables and i need to pull the date, time,ID, plus a > couple other columns from each. > Can i do it in one step?? > So i want to tell the query to go pick these 5 columns from all the > different tables. > Thanks Matt
- Next message: Brendan Reynolds: "Re: How would my database write a number with letters?"
- Previous message: shanem: "Can a query return a result greater than 255 characters?"
- In reply to: Matt_Fairfield: "30 tables I need the Same 5 fields from wach of them!!!"
- Next in thread: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Reply: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Reply: Matt_Fairfield: "Re: 30 tables I need the Same 5 fields from wach of them!!!"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|