Php MySQL查询选择数据
尝试查询4小时。例如,我有这样的数据:Php MySQL查询选择数据,php,mysql,sql,select,Php,Mysql,Sql,Select,尝试查询4小时。例如,我有这样的数据: did title number_link ltitle 35 about.html 1 NULL <- this 35 about.html 2 NULL <- this 36 about.html 1 NULL 35 contact.php 1 NULL <- th
did title number_link ltitle
35 about.html 1 NULL <- this
35 about.html 2 NULL <- this
36 about.html 1 NULL
35 contact.php 1 NULL <- this
35 contact.php 3 NULL <- this
36 contact.php 1 NULL
did标题编号\u链接
35 about.html 1 NULL此查询将允许您获取行中的所有列,而不仅仅是标题
和数字链接
SELECT a.*
FROM tableName a
INNER JOIN
(
SELECT title, number_link, MIN(did) did
FROM tableName
GROUP BY title, number_link
) b ON a.title = b.title AND
a.number_link = b.number_link AND
a.did = b.did
按标题、编号链接从表组中选择标题、编号链接 你能告诉我们你在4小时内试过什么吗?
SELECT a.*
FROM tableName a
INNER JOIN
(
SELECT title, number_link, MIN(did) did
FROM tableName
GROUP BY title, number_link
) b ON a.title = b.title AND
a.number_link = b.number_link AND
a.did = b.did
SELECT *
FROM table_name
GROUP BY title, number_link