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) Quote 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) Quote 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] Quote Link to comment https://forums.phpfreaks.com/topic/6126-cant-make-this-work/#findComment-22333 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.