help me for writing an sql query
This should work:

WITH cte(id, controller_id, RTC, signal_plan, rw) AS 
(
     SELECT
         id,
         controller_id,
         RTC,
         signal_plan,
         ROW_NUMBER() OVER (PARTITION BY signal_plan ORDER BY id) rw
     FROM your_table)

     SELECT
         id,
         controller_id,
         RTC,
         signal_plan
     FROM cte
     WHERE rw = 1;