Optimise and merge SELECT query results from 2 tables I have a schema like this:

And a query like this
SELECT
  `users`.user_id,
  `users`.user_name,
  `users`.user_email,
  `users`.user_password_hash,
  meta_a.first_name,
  meta_b.last_name

FROM (SELECT m.meta_value AS first_name
   FROM `users` AS u
     LEFT JOIN `usermeta` m ON u.user_id = m.user_id
   WHERE u.user_name = 'demo' AND meta_key = 'first_name'
   LIMIT 1
  ) AS meta_a,
  (SELECT m.meta_value AS last_name
   FROM `users` AS u
     LEFT JOIN `usermeta` m ON u.user_id = m.user_id
   WHERE u.user_name = 'demo' AND meta_key = 'last_name'
   LIMIT 1
  ) AS meta_b,

  users

  LEFT JOIN `usermeta` USING (user_id)
WHERE `users`.user_name = 'demo'
LIMIT 1

Is it possible to optimize/shorten this query to get the same results instead of using a lot of these multiple SELECTs?
So at the end I get all the meta_key and meta_values that are associated to that user_id.
Try this:

SELECT u.user_id,
       u.user_name,
       u.user_email,
       u.user_password_hash,
       fn.meta_value,
       ln.meta_value
FROM   `users` AS u LEFT JOIN `usermeta` AS fn ON u.user_id = fn.user_id
                    LEFT JOIN `usermeta` AS ln ON u.user_id = ln.user_id
WHERE  u.user_name = 'demo'
AND    fn.meta_key = 'first_name'
AND    ln.meta_key = 'last_name'
LIMIT  1