title: How do I delete x no. of rows from the top with a certain condition
body: <p>Is there a way to delete x number of records from the top if equipstatus is equal to operation.
  and another requirements if the succeeding equipstatus have multiple values of operation only one will be retain (first records). please find below sample data.</p>
  <pre><code>-- SAMPLE TABLE
  CREATE TABLE equipment (
  equipstatus varchar(50), 
  dt datetime,
  id varchar(35),
  PRIMARY KEY (id)
  </code></pre>
  <p>);</p>
  <pre><code>-- SAMPLE DATA
  INSERT INTO equipment(equipstatus, dt, id) 
  VALUES
  ('operation','2021-08-31 09:30:09','001'),
   ('operation','2021-08-31 09:42:09','002'),
   ('operation','2021-08-31 11:45:09','003'),
   ('work','2021-08-31 12:50:09','004'),
   ('operation','2021-08-31 14:20:09','005'),
   ('work','2021-08-31 16:30:090','006')    , 
   ('operation','2021-08-31 17:30:09','007'),
   ('operation','2021-08-31 17:45:09','008')   ,
  ('work','2021-08-31 17:58:09','009'); 
  
  
  EXPECTED RESULT
  equip_status-------dt------------id
  work--------2021-08-31 12:50:09---004
  operation---2021-08-31 14:20:09---005
  work--------2021-08-31 16:30:09---006 
  operation---2021-08-31 17:30:09---007
  work--------2021-08-31 17:58:09---009
  </code></pre>