when i have run the 1 quey no data show
With cte AS(
SELECT top 6 ROW_NUMBER() OVER(PARTITION BY c.u_id ORDER BY c.u_id DESC) AS RowNum , a.to_id, c.*, a.from_id, b.id as 'bid', c.u_id as 'cuid' from tblfrequst a
join tbluserinfo b on a.to_id=b.id
join story c on c.u_id=b.id
where a.from_id=10 and a.request_status='AC'
UNION
select top 6 ROW_NUMBER() OVER(PARTITION BY c.u_id ORDER BY c.u_id DESC) AS RowNum, a.to_id,c.*, a.from_id, b.id, c.u_id from tblfrequst a
join tbluserinfo b on a.from_id=b.id
join story c on c.u_id=b.id
where a.to_id=10 and a.request_status='AC' )
SELECT * FROM cte WHERE RowNum < =1 and DATE_TIME > DATEADD(day, -1, GETDATE()) order by st_id desc
SELECT *
FROM STORY
WHERE DATE_TIME > DATEADD(day, -1, GETDATE())