Compare columns of same table

  • Hello,

    I gota table called sampletable, with columns country varchar(100),input_country varhcar(100),output_country varchar(100).

    I want the rows where the country column (with no blanks/space in the field) equals input_country(which is already with no blanks/spaces) column.

    can you help me in building up the query.

    I am trying siomething like this, but striking up with errors

    select * from sampletable where

    (replace(country,' ','')= input_country

  • You've just got an extra opening bracket that you never close:

    select * from sampletable where

    (replace(country,' ','')= input_country

    Should be:

    select * from sampletable where

    replace(country,' ','')= input_country

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

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