입력 SQL insert into table_name values('','','',''); insert into table_name(칼럼1,칼럼2,칼럼3)values('','',''); 삭제 delete from table_name where uid='$uid';
수정 update table_name sert 칼럼1='값',칼럼2='값' where uid='$uid'; update mybbs set count=count+1 where uid='2';
보기 select * from table_name; select * from table_name order by uid DESC; select * from table_name order by uid ASC; select 칼럼1,칼럼2,칼럼3 from table_name order by uid DESC; select * from table_name order by uid DESC limit 10; select * from table_name order by uid DESC limit 0,10; select * from table_name order by uid DESC limit 10,10; select count(*) from table_name; select * from table_name where uid='$uid'; select * from table_name where title like '$string'; select * from table_name where uid='$uid' and name='$yname'; select * from table_name where uid='$uid' or name='$yname'; select * from table_name where uid='$uid' or name like '$yname';
select distinct 칼럼 from table_name;
select max(money) from table_name; select min(money) from table_name; select sum(money) from table_name; select avg(money) from table_name; select avg(money),max(money) from table_name where name='$aaa'; select avg(money),max(money) from table_name where name='$aaa' group by name
|