IN的另类写法

EXPLAIN SELECT * FROM `tcb_capital_log` WHERE id IN(66,79,47)

EXPLAIN SELECT * FROM (
	SELECT 66 AS id UNION ALL
	SELECT 79 AS id UNION ALL
	SELECT 47 AS id
) AS tmp , tcb_capital_log WHERE
tcb_capital_log.id = tmp.id

  

posted @ 2017-02-04 16:38  Adtuu  阅读(268)  评论(0编辑  收藏  举报