Can i use cursor inside a cursor in sybase?
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.
精彩评论