![](/img/trans.png)
[英]PHP (codeigniter) - How to check if the next two rows have value?
[英]PHP & MYSQL - How To Check If Two Or More Rows Have The Same Field Value
所以这就是我今天无法解决的问题。
我想从数据库中获取一些细节。 我不知道如何解释这一点。 但是这里。
数据库示例:
1 | 说明| ABC
2 | 说明| ABC
3 | 说明| 高清
我想选择标识符为“abc”的第一行,然后我想跳过具有相同字段“abc”的下一行。
我正在尝试在PHP中的SELECT mysql_query中使用它
要获得完整的行,您可以执行此操作
select * from your_table
where title in
(
select min(title)
from your_table
group by identifier
)
这个?
SELECT DISTINCT(identifier), title, description FROM tablename
在这种情况下,它也会以'def'返回行。
似乎整数字段称为“标题”。 这应该抓住最低标题#但是按照您的要求删除重复项。
select min(title) as firstTitle, description, identifier
from table_name
where identifier in (select distinct identifier from table_name)
group by description, identifier.
select min(TITLE) as TITLE, DESCRIPTION , IDENTIFIER
From your_table
Group by DESCRIPTION , IDENTIFIER
select id, description, identifier
from table group by identifier order by id asc;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.