简体   繁体   中英

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>";
}

I have to group these value. please see the image for more details

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';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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