Sql

[Sql]#2 limit, distinct, count

쁘띠뀨띠 2023. 12. 20. 18:19

limit : 일부 데이터만 가져오기

select * from orders o

where payment_method = 'kakaopay'

limit 2

결과)

 

 

distinct : 중복 데이터 제외하고 가져오기

select distinct(payment_method) from orders

결과)

 

 

count : 수 세보기

select payment_method, count(*) from orders o

where payment_method = 'kakaopay'

결과)