10-4 5-4 查询至少生产三种不同速度PC的厂商 (20 分)
生活随笔
收集整理的這篇文章主要介紹了
10-4 5-4 查询至少生产三种不同速度PC的厂商 (20 分)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一:上碼
-- 查詢至少生產三種不同速度PC的廠商-- 分析:1.聯(lián)合pc和product表,字段為廠商和速度 表1 -- 2.按廠商名字進行分組統(tǒng)計廠商的個數,篩選條件為個數大于3的 表2 -- 3.將表2 做為子表篩選出 maker-- 1. -- select maker,speed -- from pc,product -- where pc.model = product.model;-- -- 2. -- select maker,count(maker) -- from (select maker,speed -- from pc,product -- where pc.model = product.model) AS temp -- group by maker having count(maker) >= 3;-- 3.select maker from (select maker,count(maker)from (select distinct speed,makerfrom pc,productwhere pc.model = product.model) AS tempgroup by maker having count(maker) >= 3) as temp2;總結
以上是生活随笔為你收集整理的10-4 5-4 查询至少生产三种不同速度PC的厂商 (20 分)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 西瓜汁的功效与作用、禁忌和食用方法
- 下一篇: 黑米饭的功效与作用、禁忌和食用方法