Hi frinds,
There are lot tables in my view.I am unable to find the unwanted row that came in the specific table.
I am getting Branch Name text in the Storename column in the view and TotalPrice getting Null text in the view.
How to find out that row related table or previous row or next row of that unwanted row?

Mohammad HussainRank #513 · 4.8K reputationPosted Aug 7, 2023, 4:30 AM EDT
WITH OrderedView AS ( SELECT *, ROW_NUMBER() OVER (ORDER BY ) AS RowNum FROM your_view_name ), UnwantedRow AS ( SELECT * FROM OrderedView WHERE Storename = 'Branch Name' AND TotalPrice IS NULL ) SELECT UnwantedRow.*, PreviousRow.*, NextRow.* FROM UnwantedRow LEFT JOIN OrderedView AS PreviousRow ON UnwantedRow.RowNum = PreviousRow.RowNum + 1 LEFT JOIN OrderedView AS NextRow ON UnwantedRow.RowNum = NextRow.RowNum - 1;This query will return the unwanted row along with the previous row and next row in the ordered view. The LEFT JOINs are used to find the corresponding rows based on the RowNum.
Remember to replace
with the appropriate column name to order the rows correctly. Additionally, replaceyour_view_namewith the name of your view.