Article View: cn.bbs.comp.database
Article #1422Re: SQL�������
From: ���빤
Date: Tue, 24 Apr 2007 13:42
Date: Tue, 24 Apr 2007 13:42
24 lines
1685 bytes
1685 bytes
select * from
(select code,sum(cnt) as s from p13 group by code) as p ,
(select code,sum(cnt) as s from p18 group by code) as q
where p.code=q.code and q.s > p.s*1.1
�� �� YOFO (�ɺ�����) �Ĵ������ᵽ: ��
: �����ű?p13,p18,�ֱ��¼����Ľ������
: ���ű���������ֶΣ�������code��������cnt��for example:
: code cnt
: 11 300
: 23 30
: 30 4
: 11 200
: 78 45
: 30 5
: . .
: . .
: Ҫ������Ľ������������������ܣ�������Ӧ�������仯10%���ϵĽ����룬��������
: ��ʾ������
: �����Ǻ��ѣ�����Ϊ���ڼ��ã���SQL��ò���ˣ������æһ�£�лл��
--
[m[1;32m�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 59.78.46.141][m
Technical Details
Message-ID:
<4TcPfc$b0e@bbs.sjtu.edu.cn>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!news.szu.edu.cn!bbsnews.sdu.edu.cn!SJTUBBSShow Full Headers
Complete Article Headers
X-Google-Thread: 101948,ade6a87fb7c23e4b,start X-Google-Attributes: gid101948,public X-Google-Language: Chinese,GB Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!news.szu.edu.cn!bbsnews.sdu.edu.cn!SJTUBBS From: Programmer.bbs@bbs.sjtu.edu.cn (���빤) Newsgroups: cn.bbs.comp.database Subject: Re: SQL������� Date: 24 Apr 2007 13:42:35 GMT Organization: ��ˮ˼Դ Message-ID: <4TcPfc$b0e@bbs.sjtu.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: database/M.1177422038.A