This a fairly straightforward issue.
I have a value in a MySQL table that I need to grab and place into a new table. I should also say that this will not denormalize my table as the value being pulled is in a temporary table/row etc.
In any case, this is an example of an attempt I made to do so:
INSERT INTO checkIn(t_id, p_id, checkIn, checkedOut) VALUES(2,11,curdate(), (SELECT checkedTime FROM checkOut WHERE t_id = 2));
As one can see, the value I’m trying to pull from the other table is denoted by the SELECT statement. When it is executed, only the SELECT statement is run – not the insert. Personally, I don’t feel that this is the correct approach to accomplish my goal.
Any insight would be appreciated.
don’t use values… do a straight insert like..