Please help to point out the error(s) in the SQL code:
select
c.cust_nam,
count s.qty_sold
from
customers c and
sales s
where
c.cust_id = s.cust_id,
s.sale_dat >= ‘20100101’,
s.sale_dat <= ‘20101231’
group by
c.cust_nam
Please help to point out the error(s) in the SQL code:
select
c.cust_nam,
count s.qty_sold
from
customers c and
sales s
where
c.cust_id = s.cust_id,
s.sale_dat >= ‘20100101’,
s.sale_dat <= ‘20101231’
group by
c.cust_nam
•
google 'SQL Join'
-胡说之-
♂
(189 bytes)
()
01/08/2011 postreply
17:22:20
•
后面的条件也不能用逗号,用 AND/OR
-胡跟之-
♀
(0 bytes)
()
01/08/2011 postreply
17:45:19
•
跟得好,这才名副其实
-胡说之-
♂
(0 bytes)
()
01/08/2011 postreply
17:48:59
•
错了,这个可不是胡跟:)
-胡跟之-
♀
(0 bytes)
()
01/08/2011 postreply
17:52:30
•
还是错了,老师也不是胡说:D
-胡跟之-
♀
(21 bytes)
()
01/08/2011 postreply
18:05:22
•
Group by customer name? Doesn't make sense
-世界无童话-
♀
(0 bytes)
()
01/08/2011 postreply
19:11:47
•
语法上没问题,如果是公司名也make sense
-胡跟之-
♀
(0 bytes)
()
01/08/2011 postreply
19:49:25
•
You can write like this
-oops_yz-
♀
(394 bytes)
()
01/08/2011 postreply
20:49:17
•
回复:Please help in SQL code and Thank you
-未知未觉-
♀
(980 bytes)
()
01/08/2011 postreply
22:23:49
•
This is correct!
-平安是福mtl-
♀
(0 bytes)
()
01/09/2011 postreply
08:53:33
•
这个答案真标准,工整明了。:)
-八音涧-
♀
(0 bytes)
()
01/09/2011 postreply
18:22:43
•
Thank 胡说之, 胡跟之, 世界无童话, oops_yz, 未知未觉, 平安是福mtl, 八音涧
-luck2010-
♀
(0 bytes)
()
01/09/2011 postreply
21:01:17
•
how about this:
-greentree2010-
♀
(285 bytes)
()
01/09/2011 postreply
22:03:27
WENXUECITY.COM does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by other users.
Copyright ©1998-2025 wenxuecity.com All rights reserved. Privacy Statement & Terms of Use & User Privacy Protection Policy