简体   繁体   English

无法使用不同的值获得2个值

[英]Unable to get 2 values using distinct

I have created a product slider that is working with banner id and category i want to call category but not the duplicates one i tried to do using distinct but it's not working out for me 我创建了一个产品滑块,该滑块可以使用横幅ID和类别,但我想调用类别,但不能使用我尝试使用“ distinct”尝试执行的重复项,但对我来说效果不佳

here is what i used 这是我用的

<?php     
$cat_query = mysqli_query($connection, "SELECT DISTINCT category,bid FROM banners WHERE category != 'None'");
?>

but still i am getting duplicates records can anyone help me out as i want too get bid and category as well both 但我仍然收到重复记录,有人可以帮我吗,因为我也想同时获得出价和类别

There is no way you can get Distinct Categories with bid. 您无法通过出价获得不同类别。 You should either use Distinct Categories alone or sort your data based on required bid. 您既可以单独使用“不同类别”,也可以根据所需出价对数据进行排序。

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

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