Can anyone help me with formatting the following postgreql requests another way?
SELECT count(o.product_id), p.title FROM orders o, products p WHERE
p.product_id = o.product_id AND o.order_date > current_date - 7
GROUP BY p.title;
SELECT sum(p.price) AS total, o.order_date from products p, orders o
WHERE p.product_id = o.product_id AND o.order_date > current_date - 7
GROUP BY order_date;
I have tested the requests in Postico and PGweb with my tables and both commands give the desired output, but when i put them into my code i get the following error.
error: operator does not exist: date > integer
Here is a copy of the table schemas
orders(id PRIMARY KEY, order_number INTEGER, product_id INTEGER, user_id INTEGER,
tracking_id VARCHAR(50), order_date DATE)
products(product_id PRIMARY KEY, title VARCHAR(200), description VARCHAR(2500),
price NUMERIC(7,2), img TEXT, brand VARCHAR(50), horsepower INTEGER,
deck_size INTEGER, product_type VARCHAR(5))
The product_id in the orders table references product_id in products.
Here are screenshots of the tables for visualization:

intbeforePRIMARY KEYto get the table definitions to work)o.order_date > current_date - 7will work. Your query as shown works just fine, see here: rextester.com/VRO13048 I assume the error is somewhere else in your code.