Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 757.9k

How to use UNION ALL in SQL query.

Dec 19 2016 12:20 AM
Sir,
 
I need your help in below query.
 
I need to use order by and UNION ALL in  query  given below in order to get 1000 rows in a single execution.  
 
select strCustomerID, strDate, strUser, strAction from
( select top 1 *
from tblFollowupdetail where strCustomerID='AB7356'
and strDate between convert(datetime,'01/12/2016',103)
and convert(datetime,'15/12/2016',103)
order by strDate desc ) last
 

Answers (8)