Delete query with like option is not working

  • Hi friends ,

    I need to Delete from table with conditions :

    Example of my query!!!

    Delete from TAble A where Input_type like 'COLD%' and Input_type like 'ChartMover%'

    when I try to exceute the above query the result show '0 rows affected'

    where as when I try to check using "selete" actually there are records with "Input_type like 'ChartMover%'"

    But my delete is not working with same column to delete with 2 different likes??

    IS my query incorrect??

    Can anyone suggest

    Thanks in advance!!

  • komal145 (6/22/2012)


    Hi friends ,

    I need to Delete from table with conditions :

    Example of my query!!!

    Delete from TAble A where Input_type like 'COLD%' and Input_type like 'ChartMover%'

    when I try to exceute the above query the result show '0 rows affected'

    where as when I try to check using "selete" actually there are records with "Input_type like 'ChartMover%'"

    But my delete is not working with same column to delete with 2 different likes??

    IS my query incorrect??

    Can anyone suggest

    Thanks in advance!!

    Your query is incorrect. Your DELETE statement will only delete a record if the value of Input_type is like 'COLD%' and 'ChartMover%'.

    Obviously this field can have only one of these values in a specific row (record).

  • Thank you!!!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply