Ramco Ramco

Ramco Ramco

  • 419
  • 3.4k
  • 527.8k

How to get Top 1 with below statement

Jun 23 2023 10:57 AM

Hi

  In below statement i want to get Top 1 record

CASE
    WHEN (
        SELECT COUNT(*)
        FROM SessionDeliveryParticipant AS sub
        WHERE sub.[SessionDeliveryCalendarID] = [SessionDeliveryCalendarID]
        AND sub.PresentInSession = 0
    ) = COUNT(*) THEN 1
    ELSE 0 End

Thanks


Answers (4)