473,397 Members | 2,056 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Copy Records from two tables to new Table

ak1dnar
1,584 Expert 1GB
I have two table in my end.
Clinics
Hospitals

Now I need to get some records from this Query and Insert them to a new table

Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2. Clinics.clinic_no,
  3. Clinics.Hosptl_no,
  4. Hospitals.Hosptl_no,
  5. Hospitals.hosptl_name
  6. FROM Clinics
  7. INNER JOIN Hospitals ON Clinics.Hosptl_no = Hospitals.Hosptl_no
  8.  
Jul 17 '07 #1
5 3861
hariharanmca
1,977 1GB
I have two table in my end.
Clinics
Hospitals

Now I need to get some records from this Query and Insert them to a new table

Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2. Clinics.clinic_no,
  3. Clinics.Hosptl_no,
  4. Hospitals.Hosptl_no,
  5. Hospitals.hosptl_name
  6. FROM Clinics
  7. INNER JOIN Hospitals ON Clinics.Hosptl_no = Hospitals.Hosptl_no
  8.  
you can try this

Expand|Select|Wrap|Line Numbers
  1. insert into NewTableName (Field1, Field2, Field3, Field4) SELECT 
  2. Clinics.clinic_no,
  3. Clinics.Hosptl_no,
  4. Hospitals.Hosptl_no,
  5. Hospitals.hosptl_name
  6. FROM Clinics
  7. INNER JOIN Hospitals ON Clinics.Hosptl_no = Hospitals.Hosptl_no
Jul 17 '07 #2
ak1dnar
1,584 Expert 1GB
Thanks a bunch hariharanmca.
Jul 17 '07 #3
hariharanmca
1,977 1GB
Thanks a bunch hariharanmca.

You are most welcome moderator
Jul 17 '07 #4
ak1dnar
1,584 Expert 1GB
You are most welcome moderator
Mod for PHP-Forum not to here :)
Jul 17 '07 #5
hariharanmca
1,977 1GB
Mod for PHP-Forum not to here :)
okay, No problem...cool
Jul 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
0
by: vojtech | last post by:
Hi, I would like to remark on a problem described by Stephen Livesey almost 3 years ago, about the slowdown he had experienced with an upload of several millions of rows. ...
3
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
1
by: LarryH | last post by:
I am new to Access and have one small problem I can't seem to solve. I have a database with multiple order records for people. Each person has a unique ID, and is on the datbase multiple times,...
5
by: John Baker | last post by:
Hi: I have set up a table, and a temporary copy of the table which I wish to use for some processing. I have found that using a query to empty the ORIGINAL table, the copy of the table gets...
19
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
0
by: igendreau | last post by:
I have a database with a Header table. Each record in tblHeader has two One-to-Many Relationships: with tblLines and tblKeys. The HeaderID field ties tblHeader to the other two tables. The data...
2
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
5
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.