开发者

Can i use cursor inside a cursor in sybase?

开发者 https://www.devze.com 2023-04-12 18:58 出处:网络
i want to use cursor inside 开发者_JAVA百科a cursor or can i write query like select t.name,t1.name

i want to use cursor inside 开发者_JAVA百科a cursor

or can i write query like

select t.name,t1.name 
from dbo.sysobjects as t, dbo.sysobjects as t1 
where t.name like 'a%' or t1.name like "b%a" 

and use a single cursor to fetch the both kind of table name?


You can use a cursor inside another cursor (not recommended!).

But if that is what you want you can use a cursor with one query only.

If you want cartesian query it's like this:

select t.name, t1.name from dbo.sysobjects t, dbo.sysobjects t1
where t.name like 'a%' or t1.name like 'b%a'

If you want another type of query just tell what do you expect to see as the result.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号