데이터베이스의 테이블 보기
show tables
테이블의 모든 데이터 가져오기
select * from 테이블 이름
테이블의 특정 필드 데이터 가져오기
select 특정 필드명1, 특정 필드명2 from 테이블 이름
select * from tmp_table
where point > 2000 and nick_name = "양배추";
select * from tmp_table
where nick_name != "양배추";
select * from tmp_table
where created_at_id between "2023-04-12" and "2023-04-18";
select * from tmp_table
where week in (1,3);
select * from tmp_table
where nick_name = "양%";
- "a%" : a로 시작하는 모든 데이터
- "_a" : 두번째 단어가 a로 시작하는데 데이터
select * from tmp_table
where nick_name = "양%";
limit 원하는 데이터 숫자
select distinct(location) from tmp_table
select count(location) from tmp_table