sql server - SQL Matching query -


i have 2 tables, 1 candidates , 1 job offers.

candidates:

candidateid first name last name email address city state 

job offers:

jobid companyname address city state 

what query have run candidates have same state job state?

and best option connect data fields website database? kind of database should use, except mysql?

to explain comments above further, either create stored procedure pass state parameter this:

create procedure dbo.getcandidatesbystate  @state varchar(2)  set nocount on begin     select c.*           ,j.companyname     candidates c     inner join job j on c.desiredjobstate = j.[state]     c.desiredjobstate = @state; end 

or, declare variable @state , pass value this:

declare @state varchar(2); set @state = 'ny'; begin     select c.*           ,j.companyname     candidates c     inner join job j on c.desiredjobstate = j.[state]     c.desiredjobstate = @state; end 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -