我需要从一个表中获取记录,其中列值将以 'some value' 开头并以 'another some value' 结尾


$nqry = mysql_query("select * FROM table_name where column_name BETWEEN 'AlertStopPressed' AND 'AlertStart'");
while($nftc = mysql_fetch_array($nqry)){
    echo $nftc['user_id']." - ".$nftc['alert_detail_id']." - ".$nftc['name']." - ".$nftc['alert_datetime']."<br>";
}

我必须对这些值进行分组。请参阅图片了解更多详情

select * from table where columnname like 'startvalue%endvalue';

您的查询

$nqry = mysql_query("select * FROM table_name where column_name BETWEEN 'AlertStopPressed' AND 'AlertStart'") and columnname like 'startvalue%endvalue';

相关内容

最新更新