How to do this in a stored procedure (SQL 2005):
count = select count(*) from table1 where line like '%success%' if count > 0: delete from table1 where not line like '%success%'
Thanks for any help. My google skills really fail today: - (
So, if there are lines in which linelike success, then delete any lines where you linedo not like success?
line
IF EXISTS (SELECT * from table1 where line like '%success%') delete from table1 where line NOT like '%success%'
I would write that in this way
if exist (select 1 from table1 where line like '%success%') begin delete from table1 where line not like '%success%' end
. ?
where.
Source: https://habr.com/ru/post/1744946/More articles:How to send emails using the return path in .net 3.5 - c #Oracle - Parameterized Query has EXECUTIONS = PARSE_CALLS - sqlPython file input line: how to handle Unicode escaped characters? - pythonFind out which row caused the error - sql-serverCan anybody say that stored procedures are for and against, and Java stored procedures are for and against? - databaseJava class in DB - javaStack overflow on CFBuilder plugin - eclipseМожет ли iPad узнать, когда ваш iPhone рядом? - iphoneIs the complete list returned first and then filtered when using linq for sql to filter data from a database or just a filtered list? - linqcreating a jar file for a Java application - javaAll Articles