채택완료

SQL명령어? phpmyadmin 질문있습니다.

2016-11-02 (수) 09:44:34 5,328

test 란 게시판이 있고

7000 ~ 13981번까지의 게시물을 삭제하고 싶은데

한번에 삭제할 수 있는 명령어가 따로 있을까요?

답변 1개 / 댓글 2개

채택된 답변
+20 포인트

delete * from g5_write_test where wr_id between 7000 and 13981

;

update g5_board

set bo_count_write = bo_count_write - (13981 - 7000) +1

where bo_table = 'g5_write_test'

;

 

전 이런식으로 처리합니다.. 

답변에 대한 댓글 2개

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* from g5_write_test where wr_id between 7000 and 13981' at line 1

이렇게 뜨네용 ㅠㅠ
delete * from g5_write_test where wr_id between 7000 and 13981
에서
delete from g5_write_test where wr_id between 7000 and 13981
로 수정;


혹시 모르니 반드시 백업을 하셔야합니다..

답변을 작성하려면 로그인이 필요합니다.