开发者

How do i replace repeating values in a row with a blank?

I have a query which returns a product, and the number of media assigned to a product, In the Campaign Amount column the values are being repeated for the same product, how do I make it just show the Campaign Amount once and then "blank" the rest of the times for that same product?? Im thinking on the lines of not eliminating repeating groups but merely showing the value once and then replacing the repeating values with a "blank" value

A link to the screenshot im talking about is:

http:开发者_开发知识库//www.quickshare.co.za/files/jppibi73/Screenshot_3.png.html

thanks


If I assume that the string "Product" is a nique ID of a product, you can get only a single instance and he number of repeating records with the following:

SELECT Product,
    AVG(`Campaign Amount`) AS Amount,
    COUNT(*) AS Occurrence
FROM TABLE
GROUP BY Product
ORDER BY Product

Although I think these are not the real field names, but here you go.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜