繁体   English   中英

我需要从一个表中获取记录,其中列值将以“某些值”开头,并以“另一种值”结尾

[英]i need to fetch records from one table where column value will be start with 'some value' and end with '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';

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM