RE: [expert] MySQL/SQL question

2001-12-31 Thread Thomas Sourmail
> So, if your papers table has the columns author_id and title, then type: > INSERT INTO papers VALUES(42, 'Mu Mesons and Quark Emissions'); Hum.. I knew that, but I meant I don't want to have to know that the author ID is 42, I want to look it up in the table AUTHORS. Anyway, the next post seem

Re: [expert] MySQL/SQL question

2001-12-31 Thread Tobias Marx
Am Mon, 2001-12-31 um 16.39 schrieb Thomas Sourmail: > INSERT INTO papers(title, journal_id, author_id, whatever) > values ('The title', > select journal_id from journal where name='The journal', > select author_id from author where name='The author', > etc..); in theory this will work, but not

RE: [expert] MySQL/SQL question

2001-12-31 Thread Mitchell, Edmund
Hi Thomas, You don't need to put your column or table names into the INSERT statement. Just put the values in the same order as the columns. So, if your papers table has the columns author_id and title, then type: INSERT INTO papers VALUES(42, 'Mu Mesons and Quark Emissions'); Then, to select all