mysql - Select TOP 1 from the result set -
i retrieve top 1 value of result set of query connected using union
select top 1 * ( select paused_time end_time production_time created_time = curdate() union select resumed_time end_time pause_timer created_time = curdate() union select end_time end_time timer_idle created_time = curdate() ) end_time order end_time desc
but not expected result.
there no top
keyword in mysql far aware. require limit
:
select * ( select paused_time end_time production_time created_time = curdate() union select resumed_time end_time pause_timer created_time = curdate() union select end_time end_time timer_idle created_time = curdate() ) end_time order end_time desc limit 1
Comments
Post a Comment