select distinct authorId from (SELECT top 100 b.name as authorName,b.id as authorId,b.ticket as ticket FROM table2 a left join table3 b on a.authorId=b.id where a.name='今天的作业' order by a.id desc)
请大家帮忙看一下: sql语句在查询分析器中可以运行,php的mssql_query却报错: sql: select distinct authorId from (SELECT top 100 b.name as authorName,b.id as authorId,b.ticket as ticket FROM table2 a left join table3 b on a.authorId=b.id where a.name='今天的作业' order by a.id desc) 错误
select distinct c.authorId from (SELECT top 100 b.name as authorName,b.id as authorId,b.ticket as ticket FROM table2 AS a left join table3 AS b on a.authorId=b.id where a.name='今天的作业' order by a.id desc) AS C