Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Closed Thread
Inserting with Select
Old 03-22-2011, 07:43 AM Inserting with Select
Extreme Talker

Posts: 177
Trades: 0
Say I have a query that inserts using a select as such:

Code:
INSERT INTO courses name, location, gid SELECT (name, location, gid) FROM courses WHERE cid = $cid
Is it possible to only select "name,location" for the insert, and set gid to something else in the query?
kbfirebreather is offline
View Public Profile
 
 
Register now for full access!
Old 03-22-2011, 09:06 AM Re: Inserting with Select
Extreme Talker

Posts: 177
Trades: 0
Found my answer.

Code:
INSERT INTO courses (name, location, gid) SELECT name, location, $this->gid FROM courses WHERE cid = $cid
kbfirebreather is offline
View Public Profile
 
Closed Thread     « Reply to Inserting with Select
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23835 seconds with 12 queries