Hi dudes,
i got some problems creating an SQL statement similar to the one mentioned in post "Query to get all Data in One Table, Matching of Another" but my one's slight more complex I guess:
Imagine I had table "items"("itemid","name" and table "prices" ("customerid","itemid" and I had to select all the items and also prices, if available, but only for one specific customer.
My current SQL looks like this:
"SELECT itemid,name,price FROM items LEFT JOIN prices ON items.itemid = prices.itemid WHERE prices.customerid = '12345'"
-> this returns only items with prices!:-(
How would I display all items with customer specific prices or (if not found) NULL?
Thanks for help!!
Sascha
i got some problems creating an SQL statement similar to the one mentioned in post "Query to get all Data in One Table, Matching of Another" but my one's slight more complex I guess:
Imagine I had table "items"("itemid","name" and table "prices" ("customerid","itemid" and I had to select all the items and also prices, if available, but only for one specific customer.
My current SQL looks like this:
"SELECT itemid,name,price FROM items LEFT JOIN prices ON items.itemid = prices.itemid WHERE prices.customerid = '12345'"
-> this returns only items with prices!:-(
How would I display all items with customer specific prices or (if not found) NULL?
Thanks for help!!
Sascha