gpt4 book ai didi

PHP Mysql DISTINCT 列当前日期

转载 作者:行者123 更新时间:2023-11-29 15:19:57 26 4
gpt4 key购买 nike

只是想让我们区分一列和当前日期的同一时间

表包含 ref,joined 那么现在需要通过 join date = Current date 来缩短

已加入 = 2019-12-21 15:10:53;

$sql = "SELECT DISTINCT ref FROM users where joined = Current date ";

如何编写这个查询可以帮助我们

最佳答案

您可以使用NOW()

$sql = "SELECT DISTINCT ref FROM users where joined = NOW() ";

您也可以使用分组依据

$sql = "SELECT ref FROM users where joined = NOW() group by ref  ";

关于PHP Mysql DISTINCT 列当前日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59433989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com