Wildcards in column name for MySQL

后端 未结 4 991
情话喂你
情话喂你 2020-12-09 19:58

I am trying to select multiple columns, but not all of the columns, from the database. All of the columns I want to select are going to start with \"word\".

So in ps

4条回答
  •  青春惊慌失措
    2020-12-09 20:42

    No, you cannot dynamically produce the list of columns to be selected. It will have to be hardcoded in your final query.

    Your current query would produce a result set with one column and the value of that column would be the string "word%" in all rows that satisfy the condition.

提交回复
热议问题