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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making it neater

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
Hi all,

I'm new to SQL and i'm using Informix for the sql but just wondering whether i can join the following sql criterias together?

select customer_no from linktable a where a.customer = 1001

then put the result from the above ([result]) into the next sql criteria:

select * from customertable where customer = [result]

Thanks for any info!!

Mel
 
Hi There

Try the following

SELECT customer FROM customertable
WHERE EXISTS
(SELECT customer_no FROM linktable a
WHERE a.customer = 1001)


Hope This Helps
Bernadette
 
Hello,
Is SQL Server linking to Informix.
If so, what are you using to replicate form informix
to SQL?
thx in advance
RGB
 
Hi mel,
I am not confirm if this you require.
It will give you different result than that from the query given by Bernadette. So please check the result and then use it.
select * from customertable
where customer in (select customer_no from linktable a where a.customer = 1001)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top