Viewing 13 posts - 1 through 13 (of 13 total)
Ok now it makes perfect sense.
I was thinkning in the wrong direction 🙂
Thanks very much
September 21, 2010 at 5:29 am
Hello, thanks but I am not quite sure I understand it.
Let me take a new example.
I have 4 tables:
Items
Orders
Purchase
Warehouse
I want to sum, for every item in itemstable, quantity in orders,...
September 25, 2009 at 3:28 pm
Great stuff.
Im on sql 2000 here som im not able to use cte, sorry.
@r.hensbergen, your query works perfect but I dont see the logic in it.
Can you explain...
January 30, 2009 at 3:04 am
SELECT table1.id,
table1.[desc],
table2.loc
sum(table2.qty1),
sum(table3.qty2)
FROM table2
INNER JOIN table1 on table2.id = table1.id
INNER JOIN table3 on table2.id = table3.id
where table1.id = '45'
GROUP BY table2.loc, table1.id, table1.[desc]
But this doesnt seem to be right
January 29, 2009 at 9:11 am
No, the query then returns
BLUE 10 1
It should be
BLUE 10 4
November 11, 2008 at 6:24 am
Ok this is great stuff but if I add this row to table1
location number quantity
BLUE ...
November 11, 2008 at 5:33 am
Great!
Both solutions work but I will go with the case scenario.
Thanks alot.
Would it be possible to group quantity and cost for lets say last month? and the month before that?
ID...
October 31, 2008 at 5:23 am
I'm not familiar with sql derived querys. Can you give me an example?
October 31, 2008 at 4:12 am
Viewing 13 posts - 1 through 13 (of 13 total)