1.string saparations. query
select STRING_AGG(EmpID,',') From
(
SELECT EmpID FROM tbl_Employee ORDER BY updatedOn DESC
OFFSET 70 ROWS FETCH NEXT 20 ROWS ONLY
) AS S;
2.in one table you need to get order by for 2 columns
ex:workflowid inorder after that sequence in desc order
for this user
SELECT WorkFlow_ID, User_ID, MAX(Approver_Sequence) AS MaxApproverSequence
FROM tbl_WorkFlowMembers
WHERE Division_ID='RAIL'
GROUP BY WorkFlow_ID, User_ID
ORDER BY WorkFlow_ID, MaxApproverSequence DESC;
No comments:
Post a Comment