I\'m sure this has been ask/answered already but I don\'t know how this kind of action is called and my SQL knowledge is limited.
I\'m searching for a single SQL statem
Couple of Joins would do the trick.
SELECT u.id, u.hash, uf_f.value AS firstname, uf_l.value AS lastname FROM user AS u LEFT JOIN user_field AS uf_f ON uf_f.user_id = u.id AND uf_f.key = 'firstname' LEFT JOIN user_field AS uf_l ON uf_l.user_id = u.id AND uf_l.key = 'lastname'