1
So holen Sie Daten von Kontakten, die 2 Produkte haben?Fetch Kontakte mit Projekten mehr als 2 im Berichtsmodul
Kontakte Tabelle
id name
1 Jon Doe
Projekte Tabelle
id Project_name
1 prod_a
2 prod_b
project_contacts Tisch
id contact_id project_id
1 1 1
2 1 2
Ich will Ergebnisse dieser Kontakte, die sowohl prod_a
und prod_b
haben
Wie dies in Berichtsmodul zur Abfrage
select c.name
from
Contacts c,
Projects p,
project_contacts pc
WHERE
c.id = pc.contact_id
and p.id = pc.project_id
and p.name = "prod_a"
and p.name = "prod_b"
I Ergebnis
geholtname
--------
John Doe
John Doe
Entschuldigung für die verspätete Antwort kann ich das Ergebnis ohne Verwendung der Anzahl erreichen. –
@NarayanPadhi, leider nein, 'count()' hier ist, um sicherzustellen, dass Sie beide das Produkt – Rahul