sql delete - I want to leave always one record if table record count = 1 with SQL -


I can delete records with this SQL section,

  remove from table ID = 2  

I always need to leave a record if the calculation of the table = 1 is also "id = 2". How can I do this?

Add a WHERE segment to ensure there is more than one line:

  Delete from the table id = 2 and (tab from selection number (*)) & gt; 1  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -