简体   繁体   中英

Inner Join listing multiple times

My Listing is showing multiple times the same result and the next again multiple times. The counting is totally different like some are 3 times shown, the next 8 times or 5 times. I could not find my Error why it shows.

The PHP Code is working because I am using it for another Project and just changed the MYSQL Request.

My SQL

SELECT p1.kArtikel,p1.cName, p1.cKurzBeschreibung, p1.dLetzteAktualisierung, p1.cSeo,
    p2.kartikelpict,p2.nNr,p2.cPfad,
    p3.fVKNetto,p3.kKundengruppe,
    p4.dStart
FROM tartikel AS p1 
INNER JOIN tartikelpict AS p2 ON p1.kArtikel = p2.kArtikel
INNER JOIN tpreise AS p3 ON p2.kArtikel = p3.kArtikel
INNER JOIN tartikelsonderpreis AS p4 ON p3.kArtikel = p4.kArtikel
WHERE DATE(dStart) > (NOW() - INTERVAL 120 DAY)
    AND p3.kKundengruppe = 1
ORDER BY p4.dStart DESC
LIMIT 50;

在此处输入图片说明

您应该使用Distinct语句

Select distinct column_name from table

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM