请教一个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]