SELECT
users.*,
(SELECT category.key as category FROM categories WHERE categories.user_id=users.id)
FROM users
WHERE category=1 // тут будет ошибка
SELECT
users.*, categories.key as category
FROM users
JOIN categories ON categories.user_id = users.id
WHERE categories.key = 1
;