Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个来自数据库的动态 ul 列表作为类别输出,但是我不想在这个特定列表中列出一个类别。是否存在停止在字段中显示一个值的 sql 选择?或者我可以在针对列表的选择查询之后编写一个 if 语句以不显示该项目吗?如果有人可以提供帮助,我将不胜感激!
SQLwhere为您提供子句来过滤您选择的结果。
where
假设您的表被调用category并且它的主键是,请在查询id中添加一些内容。where category.id != <id of category you don't want>如果您已经有一个where子句,请附加另一个条件,and而不是:and category.id != ...。
category
id
where category.id != <id of category you don't want>
and
and category.id != ...