Reputation: 15379
Is it possible in PostgreSQL to select one column from a table within a particular date span (there is a date column) and - here is the catch! - add the table together. Like for making a sales report?
Upvotes: 0
Views: 145
Reputation: 247860
Based on your comment, I think you are referring to SUM()
. This is an aggregate function
SELECT SUM(amount)
FROM sales_orders
WHERE date BETWEEN '2011-03-06' and '2011-04-06' -- not sure what your date is.
Upvotes: 1
Reputation: 171559
If I understand you correctly, you are looking for this:
SELECT sum(amount)
FROM sales_orders
WHERE date ...
Upvotes: 0