AV1611 Posted March 29, 2006 Share Posted March 29, 2006 what am I doing wrong with this subquery?insert into table2 values (Select Min(table1.it_date) AS it_date, firstpass.insptype, firstpass.`process`, firstpass.product, firstpass.descr, firstpass.rev_level, firstpass.serialno, firstpass.failed From firstpass Group By firstpass.serialno) Link to comment https://forums.phpfreaks.com/topic/6126-cant-make-this-work/ Share on other sites More sharing options...
Guest footballkid4 Posted March 30, 2006 Share Posted March 30, 2006 Av! Haven't seen you around here for a while.Anyways: Do you have an auto_inc ID in both tables? If so, you might want to provide a fieldlist, because the way you are doing it:[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] [color=green]INTO[/color] [color=orange]tblname[/color] VALUES (valuestrung) [!--sql2--][/div][!--sql3--]SQL assumes that you have a value for every column (including ID) Link to comment https://forums.phpfreaks.com/topic/6126-cant-make-this-work/#findComment-22137 Share on other sites More sharing options...
AV1611 Posted March 30, 2006 Author Share Posted March 30, 2006 Hey, Football!I went with this...[code]$query0 = mysql_query("insert into firstpass2(SelectMin(firstpass.it_date) AS it_date,firstpass.insptype,firstpass.`process`,firstpass.product,firstpass.descr,firstpass.rev_level,firstpass.serialno,firstpass.failedFrom firstpassGroup By firstpass.serialno)") or die('71'.mysql_error());[/code] Link to comment https://forums.phpfreaks.com/topic/6126-cant-make-this-work/#findComment-22333 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.