SQL Series III : SQL Fundamental ORDER BY

select productName, productCode buyPrice
from products
order by buyPrice asc;
select productName, productCode buyPrice
from products
order by buyPrice desc ;
select concat(firstName,' ',lastName) as Name
from employees
order by Name asc;
select concat(firstName,' ',lastName) as Name
from employees
order by Name desc;

Penggunaan ORDER BY Pada Lebih dari Satu Kolom

select productName, productLine, quantityInStock, buyPrice
from products
order by buyPrice desc, productLine;

--

--

I’m a Data Scientist who never stop learning.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store