由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - 请教set和select 的区别
相关主题
error of executing SQL query of string concatenation (转载请帮忙读懂这个sql script
请教大虾问题哈,包子谢哈怎样快速得到两个表的交集
求助:如何ColumName 作为变量放入query菜鸟问题,急
问个 sp_send_dbmail 的问题SQL 查询已经解决.谢谢Modeler,mirthc,cheungche
请问sql server里面怎么输出变量到文本文件?mysql 问题 (转载)
有包子!sql procedure 来rank不同table里面的数据请教高手,包子谢
SQL question: update a fieldhow to write this query
SQL请教...怎么写这样的distribution list请问个join的问题
相关话题的讨论汇总
话题: select话题: set话题: declare话题: sp话题: int
进入Database版参与讨论
1 (共1页)
c**t
发帖数: 2744
1
In a SP
declare @x int
declare @y int
...
what's the difference between "set @y=@x " and "select @y=@x"
Thx.
c**t
发帖数: 2744
2
Who can tell the difference?
555~~~~~~~~~~~~

【在 c**t 的大作中提到】
: In a SP
: declare @x int
: declare @y int
: ...
: what's the difference between "set @y=@x " and "select @y=@x"
: Thx.

n**m
发帖数: 255
3
where you can use:
select @y = @x?
it is not sql!!!!!!!!

【在 c**t 的大作中提到】
: Who can tell the difference?
: 555~~~~~~~~~~~~

c**t
发帖数: 2744
4
No problem.
I tried this in query analyzer.

【在 n**m 的大作中提到】
: where you can use:
: select @y = @x?
: it is not sql!!!!!!!!

t********k
发帖数: 808
5
在Sybase中
好象要用
select @y=@x 来赋值吧
有点儿忘了

【在 c**t 的大作中提到】
: In a SP
: declare @x int
: declare @y int
: ...
: what's the difference between "set @y=@x " and "select @y=@x"
: Thx.

aw
发帖数: 127
6
copied from online
c**t
发帖数: 2744
7
Interesting. I thought it's rather than that.
I have a SP to do some calculation (as follows). If I use set (--###),
some of '--*' will print " 390 0 ", after that all *B will be 0.
If I use select the two numbers are always the same. That's why I brought
this question.
while (@@fetch_status <> -1)
select @v1=isnull(field, 0) from table1 where @cur_x ..
select @v2=isnull(field, 0) from table2 where @cur_x ...
set @v1B=@v1 --###
set @v2B=@v2 --###
print cast(@v1 as varchar)

【在 aw 的大作中提到】
: copied from online
1 (共1页)
进入Database版参与讨论
相关主题
请问个join的问题请问sql server里面怎么输出变量到文本文件?
请求SQL语句有包子!sql procedure 来rank不同table里面的数据
数据库查询一个小问题SQL question: update a field
问个SQL问题- partial outer joinSQL请教...怎么写这样的distribution list
error of executing SQL query of string concatenation (转载请帮忙读懂这个sql script
请教大虾问题哈,包子谢哈怎样快速得到两个表的交集
求助:如何ColumName 作为变量放入query菜鸟问题,急
问个 sp_send_dbmail 的问题SQL 查询已经解决.谢谢Modeler,mirthc,cheungche
相关话题的讨论汇总
话题: select话题: set话题: declare话题: sp话题: int