Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying array in "(x, y, z)" format to use in query

Status
Not open for further replies.

kev510

Programmer
Jul 12, 2006
61
Hello everyone!

I've searched everywhere for an answer to my question with no luck. I've never used an array (yes I am a newb) before.

What I'm trying to do is to get a set of data --> select X, Y, Z from Table where number = 1

Which will always return one row and and obviously three columns, into an array called "XYZArray", so I can use it in another query like this --> select Supervisor from Table2 where number not in (insert the XYZArray array here)

Thanks for any help! Happy holiday season everyone
 
Why using an array ?
SELECT Supervisor FROM Table2
WHERE number NOT IN(SELECT X FROM Table WHERE number = 1)
AND number NOT IN(SELECT Y FROM Table WHERE number = 1
AND number NOT IN(SELECT Z FROM Table WHERE number = 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
goodness, i feel extremely stupid now.

Thank you so much for your help!

PS: If I ever did need to put it in (x,y,z) format, how would it be done? Is it goign to be a complicated step, like programming to add commas between each value, and parenthesis?

Thanks once again.

-Kev
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top