We have 2 tables.
users userID name 1 Имя 1 2 Имя 2 3 Имя 3 user_contact contactID userID FirstField secoundField 1 1 val of Имя 1 Это для Имя 1 2 1 val of Имя 1 Это для Имя 1 3 3 val of Имя 3 Это для Имя 3
The essence of the problem is that you need to pull out more fields, not just FirstField. Such request pulls out only 1.
SELECT u.*, ( SELECT `FirstField` FROM `user_contact` v WHERE u.`userID` = v.`userID` limit 1 ) as `userID` FROM `users` u;
Result of this query
userID name FirstField 1 Имя 1 val of Имя 1 2 Имя 2 null 3 Имя 3 val of Имя 3
I need userID name FirstField secoundField 1 Name 1 val of Name 1 This is for Name 1 2 Name 2 null null 3 Name 3 val of Name 3 This is for Name 3
ORDER BY does not channel because it uses a lot of resources.