祝愿大家身体健康!

 站点注册  找回密码
 站点注册

QQ登录

只需一步,快速开始

查看: 4023|回复: 0

请教一个cursor的题,谢谢

[复制链接]

请教一个cursor的题,谢谢

[复制链接]
jayyj

主题

0

回帖

2

积分

新手上路

积分
2
贡献
在线时间
小时
2007-5-4 09:08:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?站点注册

×
In the task,you will complete a cursor that inserts data into a table,When complete,the script creats a cursor that read every type from the titles table,determines the average price for titles of titles of that type.and then inserts the information into the types table.
The script is supposed to do the following:
  a. Create a read-only cursor called type_insert on titles that       
     queries distinct data in the type column.
  b. Declare two variables:a char(12) value called @type and a
     money variable called @avg_price.
  c. Open the cursor and fetch the first row into a targer list.
  d. While there are rows remaining,calulate the average price   for the fetched type,insert the appropriate information into the
     types table,and fetch the next row.
  e. Display the data in the types table.

题目就是这样的,用到pubs2里的titles表,这个题里需要新建一个types表,从titles里取一条数据,处理之后就放在types里,请会的人帮我写一下或者点一下思路吧,我实在不会了。谢谢
共享共进共赢Sharing And Win-win Results
SYBASEBBS - 免责申明1、欢迎访问“SYBASEBBS.COM”,本文内容及相关资源来源于网络,版权归版权方所有!本站原创内容版权归本站所有,请勿转载!
2、本文内容仅代表作者观点,不代表本站立场,作者自负,本站资源仅供学习研究,请勿非法使用,否则后果自负!请下载后24小时内删除!
3、本文内容,包括但不限于源码、文字、图片等,仅供参考。本站不对其安全性,正确性等作出保证。但本站会尽量审核会员发表的内容。
4、如本帖侵犯到任何版权问题,请立即告知本站 ,本站将及时删除并致以最深的歉意!客服邮箱:admin@sybasebbs.com
您需要登录后才可以回帖 登录 | 站点注册

本版积分规则

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com

QQ|Archiver|PowerBuilder(PB)BBS社区 ( 鲁ICP备2021027222号-1 )

GMT+8, 2024-5-1 14:13 , Processed in 0.138974 second(s), 9 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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