本文介绍了SQL WHERE列=一切的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL是否可以执行以下操作:SELECT * FROM table WHERE column = everything

Is SQL able to do something along the lines of this: SELECT * FROM table WHERE column = everything

推荐答案

您的问题允许三个解释:

Your question allow three intrepretations:

  1. 您不在乎该列:将其从where子句中删除(或者,如果这是唯一的子句,则将所有where子句一起删除)
  2. 您希望设置该列,而不必关心:使用WHERE column IS NOT nULL
  3. 您想要搜索,该搜索还可以显示来自简单SQL模板的所有记录:SELECT * FROM table WHERE column LIKE '%$searchterm%'
  1. You don't care about the column: drop the it from the where clause (or drop the where clause alltogether, if this was the only subclause)
  2. You want the column to be set, bit you don't care to what: Use WHERE column IS NOT nULL
  3. You want a search, that can also display all records from a simple SQL template: SELECT * FROM table WHERE column LIKE '%$searchterm%'

这篇关于SQL WHERE列=一切的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 18:33