Skip to content
Advertisement

How to use the results of one query in the next query?

I have read answers here but I am still not quite sure how I would do this regarding two columns of a table and more than one result per query.

So, the first query would look like this in my Node app:

I need the result for the following query:

I only need the results of the second query but I fail to implement only one query doing both. Can someone help me out? Any help is appreciated.

Thank you!

Advertisement

Answer

You seem to want exists:

@profile_lid and @profile_stype are the parameters to the query – that I would recommend using instead of concatenating variables in the query string.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement