Hi @li dcik ,
Welcome to the Microsoft TSQL Q&A Forum!
Your statement is correct.
Could you please share us your table structure (CREATE TABLE …) and some sample data(INSERT INTO …)? So that we’ll get a right direction and make some test.
Regards
Echo