关于where子句的问题。哪个更有效率?
Select * from tbl t where t.date > (select convert(date,'2013-08-21'))
或
Declare @dt as date
Set @dt = (select convert(date,'2013-08-21')))
Select * from tbl t where t.date > @dt
感谢
答案 0 :(得分:1)
您不需要声明变量或执行嵌套选择:
Select * from tbl t where t.date > '2013-08-21'
这应该适合你!