470,647 Members | 1,268 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,647 developers. It's quick & easy.

SMSS Sequential Queries using the same filters

I have an question. I have a script that basically runs two queries in the same process. One query tabulates member counts (based on the where filters) then combines that with their cost data in the second query (using where filters). I receive one table. Is there a way to write it in code to have only one set of where filters, whereby the second query relies on the first queries where filters? This way I only have to modify it once?
Sep 20 '19 #1
2 1651
Rabbit
12,516 Expert Mod 8TB
Probably, yes.

We would need to see your code.
Sep 20 '19 #2
NeoPa
32,301 Expert Mod 16PB
You may be able to make use of a CTE (Common Table Expression) but, as Rabbit says, we'd need to see your code.
Sep 22 '19 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Steve Elliott | last post: by
1 post views Thread by Dieter Vanderelst | last post: by
2 posts views Thread by Jeff | last post: by
5 posts views Thread by leesa | last post: by
1 post views Thread by Korara | last post: by
reply views Thread by warner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.