色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

mysql 判斷子查詢,mysql使用ifelse語句判斷當(dāng)天是否是星期天

錢良釵2年前22瀏覽0評論
mysql 判斷子查詢,mysql使用ifelse語句判斷當(dāng)天是否是星期天?

兩種格式,一種是時間戳,一種是日期格式①SELECT IF(days = 1,"是","不是") as "是否星期天" FROM (SELECT DAYOFWEEK(FROM_UNIXTIME(time,"%Y-%m-%d")) AS days FROM table) tmp; ---time是時間戳 , days = 1代表星期天--把time 和 table 替換成你數(shù)據(jù)庫的 字段和表②SELECT IF(days = 1,"是","不是") as "是否星期天" FROM (SELECT DAYOFWEEK(date) AS days FROM table) tmp; ---date是日期格式 2017-11-21 , days = 1代表星期天--把date 和 table 替換成你數(shù)據(jù)庫的 字段和表