Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- id,
- issue,
- delivery,
- proforma,
- restoration,
- deleted,
- IFNULL(delivery, issue) AS DATE,
- totalPrice totalPrice,
- ROUND(totalPrice * (1 - discount / 100), 2) AS discountPrice,
- (SELECT
- SUM(price) SUM
- FROM
- payment
- WHERE
- invoice_id = id
- GROUP BY invoice_id)
- FROM
- invoice
- WHERE
- deleted = 0 AND user_id = 25
- HAVING DATE BETWEEN '2014-05-01' AND '2014-05-31'
- ORDER BY issue DESC
Advertisement
Add Comment
Please, Sign In to add comment