(SELECT CONCAT(`search_date_1`,' - ',`last_search_by_1`) FROM table1 WHERE id IN (SELECT MAX(id) FROM table1 WHERE jobno = table1.`jobno` AND search_by_1 !='')) AS 'Search Option 1',
(SELECT CONCAT(`search_date_2`,' - ',`search_by_2`) FROM table1 WHERE id IN (SELECT MAX(id) FROM table1 WHERE jobno = table1.`jobno` AND search_by_2 !='')) AS 'Search Option 2',
(SELECT CONCAT(`search_date_3`,' - ',`search_by_3`) FROM table1 WHERE id IN (SELECT MAX(id) FROM table1 WHERE jobno = table1.`jobno` AND search_by_3 !='')) AS 'Search Option 3'
2条答案
按热度按时间thtygnil1#
光环兄弟...
字符串
请测试此代码,如果正确请接受答案。
u0sqgete2#
我得到的查询结果是这样的
这是我的SQL查询:
字符串