如何用空白替换一行中的重复值?

发布于 2024-10-30 19:17:44 字数 326 浏览 0 评论 0原文

我有一个返回产品以及分配给产品的媒体数量的查询,在“营销活动金额”列中,同一产品的值重复,如何使其只显示一次“营销活动金额”,然后显示“空白”其余时间为同一产品?我正在考虑不消除重复组,而只是显示一次值,然后用“空白”值替换重复值

我正在讨论的屏幕截图的链接是:

http://www.quickshare.co.za/files/jppibi73/Screenshot_3.png.html

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美羊羊 2024-11-06 19:17:44

如果我假设字符串“Product”是产品的唯一 ID,则只能获取单个实例和重复记录的数量,如下所示:

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

虽然我认为这些不是真正的字段名称,但你可以了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文