'书籍导航表'idType: 是大类 如:语言 a : 是子类 如: 英语 b 是a 的子类,c是b的子类 goodsId: 对应着'商品表'的商品的id ------------------------------------------------------------- id idType a b c goodsId1 1 2 3 4 1 2 1 2 3 4 2--------------------------------------------------------------当要搜索 idType , a , b , c , = 2 时 就输出 goodsId可以用select goodsId from '书籍导航表' where idType = 2 or a = 2 or b = 2 or c = 2;sql语句怎么写才有最高的性能呢?
-------------------------------------------------------------
id idType a b c goodsId1 1 2 3 4 1
2 1 2 3 4 2--------------------------------------------------------------当要搜索 idType , a , b , c , = 2 时 就输出 goodsId可以用select goodsId from '书籍导航表' where idType = 2 or a = 2 or b = 2 or c = 2;sql语句怎么写才有最高的性能呢?