[英]How do I check my MySQL table to make sure that I don't enter the same thing twice?
[英]How do I check a MySQL column to make sure it contains a value?
我試圖從數據庫中選擇顯示='Y'並聲明!= null的所有行。 如何檢查列以確保其包含值?
$qry = "select *
from school
where display='Y'
order by name, announcement, last_update";
$qry = "select *
from school
where display='Y'
and (announcement != '' AND announcement IS NOT null)
order by name, announcement, last_update";
這既適合空白字段,又適合空字段。
announcement IS NOT NULL
要么
NOT ISNULL(announcement)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.