Home > database >  For a character in the mysql query table in all fields
For a character in the mysql query table in all fields

Time:09-25

As shown in figure:


Such as I want to check all the fields in the presence of characters' a '
Can only write so:
Select * from table1 where accession='a' or gi='a' or PDB='a' or...
Is there a simple point of writing, if the field is more, not to write a long,
Thank you very much!

CodePudding user response:

Select * from table1 where 'a' in (accession, gi, PDB,... )

CodePudding user response:

This is an unreasonable demand itself

CodePudding user response:

reference 1st floor ZJCXC response:
select * from table1 where 'a' in (accession, gi, PDB,... )

Positive solution, and get a new skill, but also it can be written:

CodePudding user response:

If it is all fields in the presence of "lookup table contains a character"?

CodePudding user response:

Query individual characters' a 'is not common, general query word, word query recommend creating FULL_TEXT index, otherwise the query efficiency is too low
  • Related