Reputation: 194
I have table test_d
which has 30 columns
and i want to search for specific string value 'ARFTU' to check in which column
does this value exists and i want to get entire row.
As i dont want to use below sql
to check each and every columns to see if the value exists, Is there any other way to write sql which checks the entire columns in table and search for specific value ?
SELECT * from test_d
WHERE name ='ARFTU'
Upvotes: 0
Views: 524
Reputation: 17
SELECT * FROM test_d WHERE 'ARFTU' IN (col1, col2, ...., col30);
Upvotes: 0