马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?站点注册
×
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里,请会的人帮我写一下或者点一下思路吧,我实在不会了。谢谢 |