데이터 추가( INSERT )
INSERT INTO table_name( col1, col2, ... ) VALUES ( val1, val2, ... );
데이터 삭제( DELETE )
DELETE FROM table_name WHERE col1=val1;
데이터 수정( UPDATE )
UPDATE table_name SET col1=val1 WHERE col_2=val2;
데이터 검색( SELECT )
SELECT col1 FROM table_name WHERE col2=val2;
SELECT col1 FROM table_name WHERE col2=val2 ORDER BY col3 DESC; // 내림차순
SELECT col1 FROM table_name WHERE col2=val2 ORDER BY col3 ASC; // 오름차순
SELECT col1 FROM table_name WHERE col2=val2 ORDER BY col3 LIMIT 3; // 0번째 부터 3개
SELECT col1 FROM table_name WHERE col2=val2 ORDER BY col3 LIMIT 4, 3; // 5번째 부터 3개
댓글 없음:
댓글 쓰기