Ich brauche ein wenig Hilfe. Ich habe drei Tabellen und dort Namen sind Halle, hall_quantified_details und hall_hall_quantified_details, und sie sieht wie folgt aus:Mysql Unterabfrage mit Where-Klausel
Halle
hall_id | hall_name
1 Hall 1
2 Hall 2
hall_quantified_details
hall_quantified_details_id | name_quantified
1 space
2 seats
hall_hall_quantified_details
hall_hall_quantified_details_id | hall_id | hall_quantified_details_id | value
1 1 1 100m2
2 1 2 500seats
Und ich möchte ba bekommen ck mit Abfrage Namen Wert und Wert für hall_id 1, ich habe Abfrage, aber es gibt mir wieder nur Namen hall_quantified_details_id ... sieht Abfrage wie folgt aus:
SELECT p.name_quantified
FROM hall_quantified_details p
WHERE p.hall_quantified_details_id IN (
SELECT pns.hall_quantified_details_id
FROM hall_hall_quantified_details pns
WHERE pns.hall_id = 1
);
i für hall_id bekommen, so wollen zurück 1 aus hall_hall_quantified_details Ergebnis, das wie folgt aussieht: Raum 100; Sitze 500 Sitze.
Sie keine Subquery wollen, können Sie eine 'JOIN' zwischen den Tabellen werden soll. –