MySQL Forums
Forum List  »  Newbie

INSERT INTO .... SELECT ....
Posted by: msnyder
Date: April 06, 2006 03:53PM

I am new to mysql and would appreciate someone helping me out with this
converting this statement from postgresql to mysql.

INSERT INTO ossurjoinquestions SELECT *, RANDOM() as random_sort,
trunc(1144355460, 0) as instanceid FROM ossurcommonquestions WHERE tid =
'3';

So far I have

INSERT INTO ossurjoinquestions( tid, question, ans1, ans2, ans3, ans4, ans5,
corans, image_path, random_sort, instanceid )
SELECT tid, question, ans1, ans2, ans3, ans4, ans5, corans, image_path
FROM ossurcommonquestions
WHERE tid = '3'

What I am not sure how to do is add RAND() as random_sort or trunc($var,0)
as instanceid.

Thank you for any help

Options: ReplyQuote


Subject
Written By
Posted
INSERT INTO .... SELECT ....
April 06, 2006 03:53PM
April 06, 2006 04:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.