Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interesting Query Problem
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Interesting Query Problem
Divers
Thread ID:
01518190
Message ID:
01518190
Vues:
105
My client has a table called CompassQueries which stores WHERE clauses:
ID            CampaignId   Query
----------------------------------------------------------------------------------------------------------------------------
425         140               [Assembly]='151' AND [Party]='R' AND [Propensity]='4'
429         140               [Assembly]='151' AND [Party]='R' AND [Propensity]='3'
430         140               [Assembly]='151' AND [Party]='R' AND [Propensity]='2'
So I now need to run a query that returns a DS of voters who match these queryies:

It would be the same as running this:
SELECT VoterID FROM tblCamp_CT WHERE  [Assembly]='151' AND [Party]='R' AND [Propensity]='2'
except the WHERE clauses come from the CompassQueries table for all rows that match the campaign.

How do I do this?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform