语法问题 被难住了!
ofei 2006-08-11 05:34:58 我想执行如下的语句,在sqlserver里可以,但在mysql里就有语法问题!
select invoice_with_status.* from invoice_with_status,(select invoiceid,max(invoicestatus_dateadded) as invoicestatus_dateadded from Invoice_with_status where InvoiceStatusID !=2 group by invoiceid) f1 where invoice_with_status.invoiceid = f1.invoiceid and invoice_with_status.invoicestatus_dateadded = f1.invoicestatus_dateadded
不知道在mysql里如何写才正确,学mysql没长时间:)
出错信息
{Microsoft.Data.Odbc.OdbcException}
System.SystemException: {"ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.17-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select invoiceid,max(invoicestatus_dateadded) as invoicestatus_"}
_retcode: ERROR
Errors: {Microsoft.Data.Odbc.OdbcErrorCollection}
Message: "ERROR [23000] [MySQL][ODBC 3.51 Driver][mysqld-4.0.17-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'select invoiceid,max(invoicestatus_dateadded) as invoicestatus_"
odbcErrors: {Microsoft.Data.Odbc.OdbcErrorCollection}
Source: "libmyodbc3.so"