I want to sort my products table by two columns: prod_price
and prod_name
.
SELECT prod_id, prod_price, prod_name
FROM Products
ORDER BY prod_price, prod_name;
How is the sorting done here? I think it happens first by prod_price
and then by prod_name
. Also, how is the above query different from this one:
SELECT prod_id, prod_price, prod_name
FROM Products
ORDER BY prod_name;
My products table is as follows:
CREATE TABLE Products
(
prod_id char(10) NOT NULL ,
vend_id char(10) NOT NULL ,
prod_name char(255) NOT NULL ,
prod_price decimal(8,2) NOT NULL ,
prod_desc text NULL
);