I tried to make a subselect in a MySQL selct statement e.g. like the following one:
SELECT
c.id AS id,
c.name AS name,
(SELECT count(*) FROM orders o WHERE o.user_id = c.id) AS order_count
FROM
customers c
Any ideas why this does not work in MySQL? Is it possible to do something like that in MySQL? Tried it in Version 3.23.58 and 5.1.60.
Thanks in advance!