>I have a cursor which is populated using a select sql. Here is a typical view of the table:
>
>
>
>Fabric Supplier Artikey Rating
>--------- ---------- ---------- --------
>Zoom Ozbucek F*000001 1.29
>TMI TMI F*002345 0.21
>Yao Hung Exquisite F*002134 1.21
>Zoom Ozbucek F*000001 0.89
>
>
>
>What I would like to do is if there are duplicate records I want to just have one record and add the rating of any duplicates. For example my new cursor would see that there is more than 1 artikey with the same artikey so it would add the rating of the second occurence to the first record then delete any duplicates. My new cursor would like:
>
>
>
>Fabric Supplier Artikey Rating
>--------- ---------- ---------- --------
>Zoom Ozbucek F*000001 2.18
>TMI TMI F*002345 0.21
>Yao Hung Exquisite F*002134 1.21
>
>
>
>
>Is this possible to do?
>
>Many Thanks
As a first stab try:
SELECT Fabric, Supplier, Artikey, SUM(Rating);
FROM table;
GROUP BY Rating
Kev