I have two tables in the database tbLicence and tbJurisdiction tbJurisdiction has two feilds
- Jurisdiction as PK
- JurisdictionX as Jurisdiction Name
tbLicence
has three feilds
- Licence as PK
- AgentId
- Jurisdiction
Let's us say
tbJurisdiction
contains values as
- 1 - Alabama
- 2 - Florida
- 3 - New York
- 4 - Mexico
- 5 - New Jersey
tbLicence
contains values as
- 1 - 224 - Florida, New York
- 2 - 304 - New Jersey, Alabama
Now I want to fetch Jurisdiction and JurisdictionX on the basis of AgentId let us say 224
I want the final output should be like
- 2 - Florida
- 3 - New York
I have tried the below query
SELECT L.Jurisdiction,
L.JurisdictionX
FROM tbJurisdiction L
Join tbLicence P on
Jurisdiction
Where P.AgentId =@AgentId;
Its not working
Please help me !!!