jayyj 发表于 2007-5-4 09:08:27

请教一个cursor的题,谢谢

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.<br/>The script is supposed to do the following:<br/>  a. Create a read-only cursor called type_insert on titles that       <br/>     queries distinct data in the type column.<br/>  b. Declare two variables:a char(12) value called @type and a <br/>     money variable called @avg_price.<br/>  c. Open the cursor and fetch the first row into a targer list.<br/>  d. While there are rows remaining,calulate the average price   for the fetched type,insert the appropriate information into the<br/>     types table,and fetch the next row.<br/>  e. Display the data in the types table.<br/><br/>题目就是这样的,用到pubs2里的titles表,这个题里需要新建一个types表,从titles里取一条数据,处理之后就放在types里,请会的人帮我写一下或者点一下思路吧,我实在不会了。谢谢
页: [1]
查看完整版本: 请教一个cursor的题,谢谢

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

Mail To:Admin@SybaseBbs.com