MySQL Forums
Forum List  »  InnoDB

Re: INSERT INTO - date type problem
Posted by: test test
Date: January 21, 2009 09:22AM

I don't obviously fully understand your question.

Where do the order dates come from ? Allways NOW () ???

Do you mean :

INSERT INTO tbl_order (customerId)
SELECT customerId
FROM tbl_customer
ORDER BY customerId DESC
LIMIT 1;
UPDATE tbl_order SET orderDate = NOW();

which is equivalent to :

INSERT INTO tbl_order (customerId, orderDate)
SELECT customerId, NOW()
FROM tbl_customer
ORDER BY customerId DESC
LIMIT 1;

Why do you use the 'LIMIT' clause ?

Options: ReplyQuote


Subject
Views
Written By
Posted
5259
January 18, 2009 02:53PM
Re: INSERT INTO - date type problem
2576
January 21, 2009 09:22AM


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.