Viewing 6 posts - 1 through 6 (of 6 total)
Is this close to what you are looking for? EXISTS can be useful for this kind of comparison.
SELECT jec_olds.*
FROM jec_sub AS jec_olds
WHERE EXISTS (
January 8, 2019 at 7:27 am
Not sure if this would be the fastest solution, but this might be ok:
DECLARE @custid int = NULL --1805;
DECLARE @ord tinyint = 1;
SELECT Refs.R_Index,...
December 21, 2018 at 5:17 pm
As a side note, the schema here is confusing and different from what would usually support an itemized bill. More normally:
Bill (id, billdate, processdate, etc)
->
Many BillItem...
December 21, 2018 at 1:23 pm
If your schema is as-posted, then no Amount exists in the Bill Item table for you to SUM. If I understand correctly, you are correct to SUM(Bill.Amount). So the correct...
December 21, 2018 at 1:03 pm
If the code you posted is literally the code you are running: the issue would be that you've SELECT'ed "p.ProductNam" and not "p.ProductName".
December 21, 2018 at 12:42 pm
Hello,
Without populating tables to test your particular example-- When dealing with unexpected rows, a good clue is that p.ProductName is your only SELECT'ed column which is not also...
December 21, 2018 at 11:03 am
Viewing 6 posts - 1 through 6 (of 6 total)