db2 concat columns in where condition

I need to search few hundreds of records (like below) in a table where the values are split into 4 different column

Records:

A  B   C     D
-- --- ----- --
01 200 12345 00  
01 200 23456 00  
01 200 23456 01  
01 201 12345 00
01 201 24567 03

In the table the above values are stored in 4 different columns A (01), B(200) , C(12345) , D(00)

Can someone help advise how to write a SQL to search all the records in the table concatenating 4 columns or any other suggestions to achieve the results?

  • The question is too vague. Please edit your question, to show an example of what your search-argument is, and what is the expected output of the query from your sample data.

    – 

  • 1

    select * from t where a || b || c || d like '%searchvalue%' ?

    – 

Leave a Comment