佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

查看: 1316|回复: 3

想要请教,怎样写这个statement

[复制链接]
发表于 24-11-2006 01:40 AM | 显示全部楼层 |阅读模式
我正在学习 SQL 碰到一些难题

http://sqlzoo.cn/a4m.htm

如何做啊尤其是

6. Assuming that any garment could be made in any of the available materials, list the garments (description, fabric, colour and pattern) which are expensive to make, that is, those for which the labour costs are 80% or more of the total cost.

[ 本帖最后由 玄劍 于 26-11-2006 12:58 AM 编辑 ]
回复

使用道具 举报


ADVERTISEMENT

发表于 24-11-2006 09:24 AM | 显示全部楼层
或许先写出你认为是对的, 然后让大伙帮你纠正.
回复

使用道具 举报

 楼主| 发表于 27-11-2006 02:32 AM | 显示全部楼层
我是想要这样做

select distinct description, fabric, colour ,pattern
from garment natural join material natural join quantities
where garment.STYLE_NO = material.MATERIAL_NO
and COST * 0.8 > ALL
(select LABOUR_COST , QUANTITY , COST
from garment , material , quantities
where end_date is null
and LABOUR_COST + QUANTITY * COST)

可是都不能-.-"
回复

使用道具 举报

发表于 27-11-2006 10:56 AM | 显示全部楼层
有join,就要有on

SELECT * FROM tableA a JOIN (tableB b JOIN tableC c ON b.field=c.field) ON a.field=b.field
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2023 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 24-9-2024 07:20 AM , Processed in 0.116674 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表