Reputation:
For example, I have a device ID of "001" each device ID has a column called total I want to retrieve only the SUM total of each device Id. How to do this please ?
SELECT
SUM(TicketSales.TotalPrice) AS expr1
FROM
dbo.TicketSales,dbo.[Transaction]
WHERE
TicketSales.DeviceID = 'mapa001'
AND SUM(TicketSales.TotalPrice) AS expr2
FROM
dbo.TicketSales ,dbo.[Transaction]
WHERE
TicketSales.DeviceID = 'mapa002'
Upvotes: 1
Views: 34
Reputation:
Try this, but read some sql tutorials, these are the basics:
SELECT SUM(TicketSales.TotalPrice) AS expr1
FROM dbo.TicketSales
GROUP BY TicketSales.DeviceID
Upvotes: 1