Inner join

1
2
3
4
5
6
SELECT `a`.*,`pivot`.`id` AS `pivot__id`,
`pivot`.`user_id` AS `pivot__user_id`,
`pivot`.`coupon_id` AS `pivot__coupon_id`,
`pivot`.`status` AS `pivot__status` FROM `cj_coupon` `a`
INNER JOIN `cj_user_coupon` `pivot` ON `pivot`.`coupon_id`=`a`.`id`
WHERE `pivot`.`user_id` = 1 AND `pivot`.`status` = 1 ORDER BY `pivot__status` ASC
1
2
3
4
5
6
7
8
9
10
[ sql ] [ SQL ] SELECT * FROM `drawer` WHERE  `cabinet_id` = 38 [ RunTime:0.000456s ]
[ sql ] [ SQL ] DELETE FROM `cabinet` WHERE `id` = 38 [ RunTime:0.000234s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 266 [ RunTime:0.000186s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 267 [ RunTime:0.000168s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 268 [ RunTime:0.000178s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 269 [ RunTime:0.000163s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 270 [ RunTime:0.000160s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 271 [ RunTime:0.000181s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 272 [ RunTime:0.000159s ]
[ sql ] [ SQL ] DELETE FROM `drawer` WHERE `id` = 273 [ RunTime:0.000168s ]