1

カテゴリとして出力されるデータベースからの動的 ul リストがありますが、この特定のリストにリストしたくないカテゴリが 1 つあります。フィールドに 1 つの値が表示されなくなる SQL 選択はありますか? または、その 1 つのアイテムを表示しないようにリストを対象とする select クエリの後に if ステートメントを記述できますか? 誰かが助けることができれば、私はそれを大いに感謝します!

4

1 に答える 1

5

SQL provides where clauses for you to filter the results you're selecting.

Assuming your table is called category and its primary key is id, add something along the lines of where category.id != <id of category you don't want> to your query. If you already have a where clause, append another condition with and instead: and category.id != ....

于 2012-06-14T23:41:01.007 に答える