Created
March 16, 2011 03:00
-
-
Save mikelopez/871939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select distinct | |
Orders.Name, | |
Orders.id as fid, | |
Orders.Date as filtereddate, | |
( | |
select sum(Orders.Total * Orders.Quantity) | |
WHERE id = fid | |
) | |
( | |
select sum(Orders.Total * Orders.Quantity) | |
where id = fid | |
) | |
from Orders | |
where cast(Orders.Date as date) >= '2011-01-01' and cast (Orders.Date as date) < '2011-01-02' | |
order by cast(Orders.Date as date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment