Hallo zusammen,
ich habe folgende Frage:
es sind 2 Tabellen (products, products_to_categories) vorhanden
nun möchte ich folgendes tun:
SELECT * FROM x.products, y.products_to_categories
WHERE x.products_status = '1'
AND y.categories_id = '22'
AND x.products_id = y.products_id
ORDER BY x.products_date_added DESC
LIMIT 0,9
Also:
Es sollen nur Artikel angezeigt werden, die auch in der zweiten Tabelle vorhanden sind (bei welcher auch noch unterschieden werden muss, ob der Wert zum zugehörigen Artikel 22 ist...
Hier mal ein Auszug:
products
--------
products_id|products_quantity|products_date_added|products_status
1 | 100 | 22.12.01 | 1
2 | 100 | 23.12.01 | 1
3 | 100 | 24.12.01 | 1
4 | 100 | 21.12.01 | 1
5 | 100 | 25.12.01 | 1
products_to_categories
--------
products_id | categories_id
1 | 21
2 | 22
3 | 22
4 | 22
5 | 23