select employeeName ,department ,headShip ,address , case sex when 'M' then '男' when 'F' then '女' end as 性别 from Employee
where address like '%上海%' or address like '%南昌%' and sex ='F' 结果:
(5) 在表sales中挑出销售金额大于等于10000元的订单。 命令:
SELECT orderNo ,sum(quantity *price ) as total FROM OrderDetail GROUP BY orderNo
HAVING sum(quantity *price )>10000 结果:
(6) 选取订单金额最高的前10%的订单数据。 命令:
select TOP 10 PERCENT orderNo , sum(quantity *price ) as total from OrderDetail group by orderNo ORDER BY total desc 结果:
(7) 查询出职务为“职员”或职务为“科长”的女员工的信息。 命令: select *
from Employee
where headShip in ('科长','职员') and sex ='F' 结果: