select table1.title,table1.content,table2.name from table1 table2 where table1.id = table2.sidorselect table1.title,table1.content,table2.name from table1 inner join table2 on table1.id = table2.sid
select a.title,a.content,b.name from table1 a,table b where a.id=b.id
select table1.title,table1.content,table2.name from table1 table2 where table1.id = table2.sid and CONTAINS(.....
这样写行吗?重复的记录会去掉吗? select table1.title,table1.content,table2.name from table1 inner join table2 on table1.id = table2.sid where contains(*,'关键字')
要不重复,只要保证派生的表2里的记录不重复。如:select table1.title,table1.content,tem.name from table1 inner join (select sid,name from table2 group by sid,name)tem on table1.id = tem.sid where contains(*,'关键字')
CONTAINS 或 FREETEXT 谓词只能在一个表上操作。请用表名来限定 * 的使用。
ok select table1.title,table1.content,table2.name from table1 inner join table2 on table1.id = table2.sid where contains(table1.*,'关键字') or contains(table2.*,'关键字') 给分
where table1.id = table2.sidorselect table1.title,table1.content,table2.name from table1
inner join table2 on table1.id = table2.sid
where table1.id = table2.sid and CONTAINS(.....
select table1.title,table1.content,table2.name from table1
inner join table2 on table1.id = table2.sid where contains(*,'关键字')
inner join (select sid,name from table2 group by sid,name)tem on table1.id = tem.sid where contains(*,'关键字')
select table1.title,table1.content,table2.name from table1
inner join table2 on table1.id = table2.sid where contains(table1.*,'关键字') or contains(table2.*,'关键字') 给分