--ORDER BY ASC--
select * from customers
order by contactname asc
select * from customers
order by country asc
select * from customers
order by postalcode asc
--ORDER BY DESC--
select * from customers
order by contactname desc
select * from customers
order by country desc
select * from customers
order by postalcode desc
--WHERE--
select * from customers
where country='Canada'
select * from customers
where country='USA'
select * from customers
where customerid=48
--WHERE CON MÁS DE UNA CONDICIÓN--
select * from customers
where
country='USA' and customerid > 50 --INTERSECCION DE CONJUNTOS
select * from customers
where
country='USA' or customerid > 50 --union DE CONJUNTOS
select * from customers
where
country='USA' or customerid > 50 or customerid < 25 --UNION DE CONJUNTOS
select * from customers
where
country='USA' and customerid > 50 and city like 'A%' --INTERSECCION DE CONJUNTOS
select * from customers
where
country='USA' and customerid > 50 and city like '%a%' --INTERSECCION DE CONJUNTOS
select * from customers
where
country in ('USA','Canada') and customerid > 50
select * from customers
where
country <> 'Canada'
select * from customers
where
not country='Canada'
select * from customers
where
country in ('France','Argentina','Spain') and contactname like 'P%'
No hay comentarios:
Publicar un comentario