嘉兴专业自助建站免费咨询,网站频繁被攻击怎么办,北京网站建设知名公司排名,网站建设工作内容一#xff1a;上码
-- 查询只卖三种不同型号PC的厂商-- 分析#xff1a;1.首先 pc和product表联合 字段为厂商
-- 2.统计这些厂商的个数过滤掉型号小于3的厂商 表1
-- 3.然后laptop和product联合 表2#xff0c;printer和product联合 字段均为厂商 表3
-- …一上码
-- 查询只卖三种不同型号PC的厂商-- 分析1.首先 pc和product表联合 字段为厂商
-- 2.统计这些厂商的个数过滤掉型号小于3的厂商 表1
-- 3.然后laptop和product联合 表2printer和product联合 字段均为厂商 表3
-- 4.将表1作为子表查询条件为 不在表2和表3中 厂商-- 1.
-- select maker
-- from pc,product
-- where pc.model product.model;-- -- 2.
-- select maker,count(maker)
-- from (select maker
-- from pc,product
-- where pc.model product.model) as temp
-- group by maker having count(maker) 3;-- -- 3.
-- select maker
-- from laptop,product
-- where laptop.model product.model;-- select maker
-- from printer,product
-- where product.model printer.model;-- 4.
select makerfrom (select maker,count(maker) from (select makerfrom pc,productwhere pc.model product.model) as tempgroup by maker having count(maker) 3) as tempwhere temp.maker not in (select makerfrom laptop,productwhere laptop.model product.model)and temp.maker not in(select maker from printer,productwhere product.model printer.model);