300x250
Notice
Recent Posts
Recent Comments
Link
목록postgres (1)
JG Story
[ Postgres ] 데이터 조회 ( Select 문 활용_1 )
1. 시간 기준 가장 먼저 ~한 대상 조회 ex) select name from animal_ins where datetime = (select min(datetime) from animal_ins); -> animal_ins 테이블에서 가장 먼저 들어온 동물 이름 조회 2. 중복된 데이터 제거 후 갯수 조회 ex) select count(distinct(name)) as name_count from animal_ins; -> animal_ins 테이블에서 중복된 이름은 하나로 취급하고, null 값은 집계하지 않도록 하여 총 이름 개수 조회 3. 중복된 데이터 대상 갯수 조회 ex) select name, count(name) from animal_ins where name is not null gro..
IT/DB
2022. 3. 29. 00:26