From: Richard L. <ce...@l-...> - 2008-05-02 17:03:25
|
Also, to be pedantic in this thread... INSERT in MySQL does allow the rather odd construction of using SET `field` = 'value' so that you can have the same query constructor for both UPDATE and INSERT. You still can't put in a WHERE clause for the INSERT itself though. ymmv naiaa On Thu, May 1, 2008 3:44 pm, Neil Young wrote: > Technically, that WHERE is in a SELECT subquery syntax, not the actual > INSERT syntax. > > Neil > > Stephen Weinberg wrote: >> Side track since the question is answered, but you can use a where >> clause >> with insert if you want to select rows from another table (or group >> of >> tables) and add them to the new table that way. >> >> insert into table_2 (col1, col2, col3) >> select A. B, C >> from table_0 join table_1 on table_0.id = table_1.id >> >> >> >> Stephen >> >> On Thu, May 1, 2008 at 3:02 PM, Neil Rest <Nei...@rc...> wrote: >> >> >>> Does INSERT take a WHERE? A new row wouldn't be qualified by a >>> WHERE >>> clause. >>> If you're updating a record, try UPDATE. >>> >>> >>> At 02:51 PM 5/1/2008, "Roderick Thomas" <tho...@ms...> wrote: >>> >>> >>>> $query_LogRecordNum="INSERT INTO ChangeLog WHERE conuid='$conuid' >>>> AND changedate='$added_reportdate' SET >>>> recordnum='$added_recordnum'"; >>>> >>> Neil >>> -- >>> Nei...@rc... >>> >>> If liberty means anything at all, it means the right to tell people >>> what they do not want to hear. >>> -- George Orwell, 1945 >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >>> Don't miss this year's exciting event. There's still time to save >>> $100. >>> Use priority code J8TL2D2. >>> >>> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >>> _______________________________________________ >>> chiPHPug-discuss mailing list >>> chi...@li... >>> https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss >>> >>> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference >> Don't miss this year's exciting event. There's still time to save >> $100. >> Use priority code J8TL2D2. >> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone >> _______________________________________________ >> chiPHPug-discuss mailing list >> chi...@li... >> https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss >> > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save > $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > chiPHPug-discuss mailing list > chi...@li... > https://lists.sourceforge.net/lists/listinfo/chiphpug-discuss > -- Can you do me a favor? Sign up for http://Facebook.com Add http://apps.facebook.com/whereivebeen/ Review it, and let 'em know Rich sent you. http://www.facebook.com/apps/application.php?id=2603626322 (Scroll down to the middle of the middle column) Give it a 5-star rating please :-) (If you can't go 5-star, email me to tell me why) |