Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MYSQL Select row if value found in any column of a particular table

Tags:

mysql

I am trying to fetch all rows from a particular table if value found in any column of the particular table.

like image 631
Prabha Avatar asked Feb 15 '23 10:02

Prabha


1 Answers

you can just use IN. eg

SELECT *
FROM tbName
WHERE yourValue IN (column1, column2, column3, ....)
like image 165
John Woo Avatar answered Feb 17 '23 03:02

John Woo