首頁 >資料庫 >mysql教程 >mysql中取系统当前时间_MySQL

mysql中取系统当前时间_MySQL

WBOY
WBOY原創
2016-05-30 17:11:051444瀏覽

<select id="getFreightEfclInventoryList" parameterType="long" resultMap="BaseResultMap1">
   SELECT
   freight_efcl_inventory_id,
   freight_efcl_id,
   closing_date,
   sailing_date,
   shipping_space_total,
   shipping_space_remain,
   shipping_space_used
   FROM
   freight_efcl_inventory
   WHERE
   1=1
   AND freight_efcl_id=#{freightEfclId}
   AND sailing_date >= DATE(current_timestamp)
   ORDER BY
   sailing_date ASC
   limit 4
  </select>

注意:sailing_date字段类型是Date类型,系统当前时间current_timestamp时间格式带时分秒的,所以需要将其转换成Date类型。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn