Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by olav78

  1. olav78

    CREATE DATABASE test IF NOT EXISTS

    CREATE DATABASE test IF NOT EXISTS. how can I do this in postgreSQL?
  2. olav78

    Sum of “sales” for each date in a timestamp column

    Thank you. But I need to group sales by day (not by millisecond ;). I figured it out by the way: SELECT to_char(date, 'YYYY') to_char(date 'Month'), to_char(date, 'DD'), to_char (date, 'Day'), sum(price) FROM sales WHERE hotel_id = 1 and date > '2006-10-09' GROUP by to_char(date, 'YYYY')...
  3. olav78

    Sum of “sales” for each date in a timestamp column

    Hi! I have a table named sales with the columns date (timestamp) and price (bigdecimal or something). I want to get the sale for each day (the sum of ‘price’ for all the rows with the same ‘date’). Like: 2006-10-10, 17 sales, 1500.00 $ 2006-10-11, 15 sales, 1400.00$ etc… This is how I try to...

Part and Inventory Search

Back
Top