Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PostreSQL: Subquery
--PostgreSQL 9.6 --'\\' is a delimiter --create a table CREATE TABLE product( product_id INT PRIMARY KEY NOT NULL, sku CHAR(50) NOT NULL, category VARCHAR(50) NOT NULL, date TIMESTAMP, price DECIMAL (10,2) ); INSERT INTO product (product_id, sku, category,date, price)VALUES (101, 'A113M1', 'Mascara', '2020-04-23', 23),(102, 'A212M2 ', 'Mascara', '2020-02-12', 23),(103, 'A221NP2', 'Nail Polish', '2020-03-07', 15), (104, 'A332NP2', 'Nail Polish', '2020-05-21', 15),(105 , 'A36LIPG', 'Lipgloss', '2020-07-15', 19); --run subquery SELECT product_id,sku,date FROM product WHERE price = (SELECT max(price) FROM product WHERE category='Mascara');
run
|
edit
|
history
|
help
0
FlujoPadre
Final 2
complicated-conditional-sql-query-to-match-attributes-for-marketing-campaigns/43219741#43219741
tegs and users
Postgres Trigger
PostgreSQL Sandbox: General Resale
to_char(now(), 'YYYYddd')
Postgres CrossTab for query with variable number of columns
PC02-DB-UTEC
Assignment 1(SET A)