问题描述:

I understood this question as I have to find out how many times the string 'word' appears as a column name in the database.

I did it using

SELECT

table_name,

column_name

FROM INFORMATION_SCHEMA.COLUMNS

WHERE column_name = 'word'

But it was marked as incorrect and we were asked to read the question carefully. I am not understanding what it is asking for?

网友答案:

The question says "containing..." so it means you are not looking for an exact match.

should rather by

SELECT count(*)
FROM  INFORMATION_SCHEMA.COLUMNS 
WHERE column_name LIKE '%word%'
相关阅读:
Top