SHARE
TWEET

REFINED QUERY

a guest Jul 16th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT  --invoicelinetable.*,
  2.         inventorytable.INVENTORYCODE,
  3.         LCASE(inventorytable.DESCRIPTION) AS Expr1,
  4.         inventorytable.UNIT,
  5.         IF(COUNT(inventorytable.INVENTORYCODE) > 1,"T","fff") AS test,
  6.         UCASE(IF(ISNULL(salesordertable.SUBCLIENTCODE),"CASH & CARRY", salesordertable.SUBCLIENTCODE)) AS SUBCLIENTCODE,
  7.         invoicetable.DATEINVOICE
  8. FROM    ((inventorycolortable RIGHT JOIN (invoicelinetable LEFT JOIN inventorytable ON invoicelinetable.INVENTORYID = inventorytable.INVENTORYID) ON inventorycolortable.COLORID = inventorytable.COLORID) LEFT JOIN salesordertable ON invoicelinetable.SALESID = salesordertable.SALESID) LEFT JOIN invoicetable ON invoicelinetable.INVOICEID = invoicetable.INVOICEID WHERE invoicetable.invoiceid = 10
  9.         -- *** NOTE USING GROUP BY, YOU SHOULD INCLUDE THE COLUMNS TO GROUP
  10.         GROUP BY    inventorytable.INVENTORYCODE,
  11.                     inventorytable.DESCRIPTION,
  12.                     inventorytable.UNIT,
  13.                     inventorytable.INVENTORYCODE,
  14.                     salesordertable.SUBCLIENTCODE,
  15.                     invoicetable.DATEINVOICE
  16.         ORDER BY salesordertable.SUBCLIENTCODE, inventorytable.INVENTORYCODE;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top