If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL Query Help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-04, 03:22
WildSeeker WildSeeker is offline
Registered User
 
Join Date: Feb 2004
Location: New York City
Posts: 3
MySQL Query Help

Hi -

I need help with building what's probably a simple query. Here's what I have:

Table A and Table B
Each with three fields ... the first two calling for the same data, the third being unique from Table A to Table B

I would like to populate Fields 1&2 of Table B with the data from Fields 1&2 from Table A, and then set the value of Field 3 of Table B to a specific value (will be identical for each record in Table B).

Any help here with building a query that will accomplish this would be greatly appreciated.

Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-07-04, 07:08
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Code:
insert
  into tableB
     ( field1
     , field2
     , field3 )
select field1
     , field2
     , 'specific'
  from TableA
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On