declare @proid intselect @proid=top 1 proid from product
declare @proid intselect @proid=top 1 proid from product
DECLARE @proid INTSET @proid=(select top 1 proid from product)
更正: declare @proid intselect top 1 @proid=proid from product
declare @proid int set @proid= ( select top 1 proid from product ) Print @proid ----OR---- declare @proid int select top 1 @proid=proid from product Print @proid
declare @proid intselect top 1 @proid=proid from product
select top 1 @proid=proid from product
declare @proid intselect top 1 @proid=proid from product
declare @proid int
set @proid= ( select top 1 proid from product )
Print @proid
----OR----
declare @proid int
select top 1 @proid=proid from product
Print @proid