Author: thiyne24 | Posted on: 1/28/2009 6:04:39 PM | Views : 1021

 

Hi,

 

Can you help me?

I have 2 queries.

I created a temp table to insert the result of my 1st query.

I need to use the values in my temp table to pass it on my 2nd query.

The problem is, my team lead doesn't allow me to use cursor.

How am I suppose to use the values I have in my tempt table to use for my second query?

 Example:

This is my first table that was already in my temptable

Select lastname, age, id from table1

 

2nd query

--need to have a looping statement here using each records I have in my temptable

select name, dept from temp2

where lastname = lastname -- name from my 1st query

and id = id -- id from my 1st query

...

Go to the complete details ...