Sql
From Chaehyun
(Difference between revisions)
(→sql) |
(→join) |
||
Line 1: | Line 1: | ||
= join = | = 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; | * 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 AND ); |
Revision as of 05:52, 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 AND );