SELECT C_Invoice.ad_org_id,C_Invoice.C_Invoice_ID, C_Invoice.DateInvoiced, C_Invoice.DocumentNo, C_Invoice.IsPaid, C_Invoice.IsSOTrx, C_Invoice.Description, C_Invoice.POReference, ips.C_InvoicePaySchedule_ID, C_Invoice.C_BPartner_ID, C_Invoice.C_Order_ID FROM C_Invoice C_Invoice INNER JOIN C_DocType d ON (C_Invoice.C_DocType_ID=d.C_DocType_ID) LEFT OUTER JOIN C_InvoicePaySchedule ips ON (C_Invoice.C_Invoice_ID=ips.C_Invoice_ID AND ips.IsValid = 'Y') WHERE C_Invoice.AD_Client_ID IN(0,11) AND C_Invoice.AD_Org_ID IN(0,1000000,11,12) AND UPPER(C_Invoice.IsPaid) LIKE "y%"
查询状况:
1.单独使用上面的语句查询,可以查询出来2条结果
2.在上面的SQL最后添加语句order by 1 或者单独添加limit语句时可以查询出2条结果
3.当你在SQL中加入order by 1 limit 0,3时有3条结果 ,order by 1 limit 0,6时有6条结果,order by 1 limit 0,7时只有2条结果