我有一个表,其中有一列type表示产品的类别,一个有3类0,1,2
现在有个页面需要把所有产品列出了,按类别列出。
类别1
select * from tab where type = 0类别2
select * from tab where type = 1类别3
select * from tab where type = 2这样做的话,执行了3次select,似乎效率不高。请问如果设计以提高效率??
谢谢