laravel如何写这种的sql语句? 
                            
                                                    
                        
                    
                    
  
                    
                    情况是这样,我建立一张水果每日销量表
CREATE TABLE `shuiguo` (
  `id` int(11) NOT NULL,
  `type` varchar(255) DEFAULT NULL COMMENT '类型,包括苹果,香蕉,梨,葡萄,西瓜',
  `value` varchar(10) DEFAULT NULL COMMENT '销量',
  `day` varchar(10) DEFAULT NULL COMMENT '日期'
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4我想着想知道某个日期的苹果,梨,葡萄 销量
最简单sql语句有
select `value` from shuiguo where `type`='苹果' and day='日期';
select `value` from shuiguo where `type`='梨'  and day='日期';
select `value` from shuiguo where `type`='葡萄'  and day='日期';我就需要执行三次sql语句,有没有一条语句就能搞定的?
然后如何我想要一段日期内的那三种水果的销量,sql语句要怎么写的?
 
           
         
                     
                     
             
             
         
             
             
             
             
           
           关于 LearnKu
                关于 LearnKu
               
                     
                     
                     粤公网安备 44030502004330号
 粤公网安备 44030502004330号 
 
推荐文章: