select a.title,a.username,b.adddate from table a,
(select max(adddate) adddate from table where table.title=a.title) b这是两种语法的合并 第一种表连接
1 select title from table a,table b
第二种 表的别名select max(adddate) adddate from table where table.title=a.title 代表 table b
select max(adddate) adddate from table where table.title=a.title 这是一个整体剩下的不用说了吧
select最基本的语法就是:
select 字段名 from 表名
给表取一个临时性的名字,可以这样写:
select 临时名.字段名 from 表名 as 临时名(有些人的习惯是把中间那个as省略掉,也是符合语法的)
你可以从整体看你的sql语句,然后再细看每一个部分。
就哪里(表)取什么数据(字段)