B
Benlem
Unregistered / Unconfirmed
GUEST, unregistred user!
use pubs
select fname,lname from employee where fname in('Paolo','Helen')
返回下面是结果集:
fname lname
------ ------------
Helen Bennett
Paolo Accorti
/*============================*/
use pubs
declare @sqlstr varchar(100)
set @sqlstr='''Paolo'',''Helen'''
select fname,lname from employee where fname in(@sqlstr)
返回下面是结果集:
fname lname
------ ------------
/*======================================*/
为什么后面的语句得不到结果,应该怎么写?
select fname,lname from employee where fname in('Paolo','Helen')
返回下面是结果集:
fname lname
------ ------------
Helen Bennett
Paolo Accorti
/*============================*/
use pubs
declare @sqlstr varchar(100)
set @sqlstr='''Paolo'',''Helen'''
select fname,lname from employee where fname in(@sqlstr)
返回下面是结果集:
fname lname
------ ------------
/*======================================*/
为什么后面的语句得不到结果,应该怎么写?