惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
P
Proofpoint News Feed
D
DataBreaches.Net
C
Check Point Blog
L
LangChain Blog
量子位
美团技术团队
Vercel News
Vercel News
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
V
Visual Studio Blog
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
U
Unit 42
腾讯CDC
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
Blog — PlanetScale
Blog — PlanetScale

博客园 - 天生舞男

迁移sharepoint Sharepoint迁移数据库之绝版(只要照着做,一定能够迁移成功) Sharepoint的webpart 虚函数和非虚函数的调用基本原则 The visio to drawing project chart. - 天生舞男 Using MSChart from a C# WinForm About the deeply copy 学习程序的自我建议---从实际软件的源代码开始学习 MS bug "The connection pool" in Oracle 10g and the data sort according to specified filed on DataGrid control. How to get response content with specified post data by post method Post method tip automation服务器不能创建对象 Get the biggest common divisor rose破解 ArrayList按Index删除的问题 Recently expection RadioButtonList中选择框和文字对不齐的解决办法 resolve problem best method is find document from official document 看了宝玉的作品,心理甚是感叹
多个平均数列的子查询
天生舞男 · 2008-01-09 · via 博客园 - 天生舞男

多个平均数列的子查询

Posted on 2008-01-09 18:08  天生舞男  阅读(318)  评论()    收藏  举报

SELECT company_name, title, teachername, company.id,average
    FROM companies company
    left outer join (select ROUND(avg(score), 2) as average, company_id
       from companycomments
       group by company_id) companycomments
    on company.id = companycomments.company_id
    left outer join
    (
     select company_id, title,teachername
     from trainings, teachers, teachers_trainings
     where teachers.id = teachers_trainings.teacher_id
           and teachers_trainings.training_id = trainings.id
    ) totalInfo
    on company.id = totalInfo.company_id