Hi
I have below sql query . I want if count of current query = 0 then it should check the condition where V.Isactive = 0 else with V.isactive = 1
Current query
(SELECT TOP 1 V.[LastSessionTentativeDate] FROM [View_StudentSubscription] V WHERE V.IsActive = 1 AND V.StudentID = t.StudentId AND V.SubscriptionStatus = 'Active' AND V.DummySubscription = '' ORDER BY V.LastSessionTentativeDate DESC) [LastSessionTentativeDate],
(SELECT TOP 1 V.[LastSessionTentativeDate] FROM [View_StudentSubscription] V WHERE V.IsActive = 0 AND V.StudentID = t.StudentId AND V.SubscriptionStatus = 'Active' AND V.DummySubscription = '' ORDER BY V.LastSessionTentativeDate DESC) [LastSessionTentativeDate],
Thanks