SEARCH
TOOLBOX
LANGUAGES
Sql

Sql

From Chaehyun

(Difference between revisions)
Jump to: navigation, search
(join)
(update)
Line 3: Line 3:
= update =
= update =
-
* UPDATE TBL_MENU AS a SET CNT = (SELECT COUNT(*) FROM TBL_ORDER_DETAIL WHERE MN_IDX = a.MN_IDX AND );
+
* UPDATE TBL_MENU AS a SET CNT = (SELECT COUNT(*) FROM TBL_ORDER_DETAIL WHERE MN_IDX = a.MN_IDX);

Revision as of 05:58, 15 February 2013

join

  • INSERT IGNORE INTO user_log (user_id, item_id, date_created, tag) SELECT a.id, b.code, b.date, 'like' FROM user_id a, review b WHERE a.author=b.author AND b.point >= 7;

update

  • UPDATE TBL_MENU AS a SET CNT = (SELECT COUNT(*) FROM TBL_ORDER_DETAIL WHERE MN_IDX = a.MN_IDX);
Retrieved from "http://chaehyun.kr/w/Sql"