资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

问一个简单的多个变量赋值问题?

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

declare   @a   int,@b   char(10),@c   tinyint  
  select   @a=(select   a   from   users   where   id=1)  
  select   @b=(select   b   from   users   where   id=1)  
  select   @c=(select   c   from   users   where   id=1)  
  我在同一个表中查询数据,要得多个变量值,如上,我要得多少就要写多少,我想问的是有没有一种方法可以只写一条查询语句查询多个值然后赋给多个变量。

网友回答:

发表者:zjcxc

declare   @a   int,@b   char(10),@c   tinyint  
  select   @a=a,@b=b,@c=c   from   users   where   id=1


 

 
热门推荐笔记本: 富士通笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved