select data_file_sid,customer_sid from sales_line_item where deleted=1 and data_file_sid != 8423737 and data_file_sid!=8424107; SELECT sum(cnt) AS DELETED_COUNT FROM ( SELECT COUNT(sli.sid) cnt FROM data_file df1 LEFT JOIN sales_line_item sli ON sli.data_file_sid = df1.sid AND sli.customer_sid = df1.customer_sid AND sli.DELETED = 1 AND sli.RESUBMITTED = 0 WHERE df1.sid = :sid AND df1.customer_sid = :cs GROUP BY df1.sid UNION ALL SELECT COUNT(ili.sid) cnt FROM data_file df1 LEFT JOIN inv_line_item ili ON ili.data_file_sid = df1.sid AND ili.customer_sid = df1.customer_sid AND ili.DELETED = 1 AND ili.RESUBMITTED = 0 WHERE df1.sid = :sid and df1.customer_sid = :cs group by df1.sid)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter