Jump to content

SQL help

Nipplemilk909

hello im trying to list candidate 2's total job history and thier current job placement. 

my faulty current sql code 

 

SELECT j.Candidate_ID,
             j.Job_tittle,
             p.Candidate_ID,
              p.Job_tittle
FROM Job_History j,
            Placement p
WHERE j.Candidate_ID = p.Candidate_ID
              and j.Candidate_ID = 2
               and 

placement table.PNG

job history.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

it is not complete and you prob have to put '2' with the appropriate quote marks

WHERE j.Candidate_ID = p.Candidate_ID
              and j.Candidate_ID = 2
               and 

 

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

29 minutes ago, SCHISCHKA said:

it is not complete and you prob have to put '2' with the appropriate quote marks


WHERE j.Candidate_ID = p.Candidate_ID
              and j.Candidate_ID = 2
               and 

 

Aren't quotation marks for strings? 

Current PC: Origin Millennium- i7 5820K @4.0GHz | GTX 980Ti SLI | X99 Deluxe 

 

Link to comment
Share on other sites

Link to post
Share on other sites

SELECT j.Candidate_ID,
               j.Job_tittle,
                p.Candidate_ID,
                 p.Job_tittle
FROM Job_History j,
            Placement p
WHERE j.Candidate_ID = p.Candidate_ID
              and (j.Candidate_ID = '2')
;

 

 

 

 

gives me an error 

Link to comment
Share on other sites

Link to post
Share on other sites

27 minutes ago, afyeung said:

Aren't quotation marks for strings? 

depends on the database engine and the data type; thats why i say probably 

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, SCHISCHKA said:

depends on the database engine and the data type; thats why i say probably 

its accses and its an auto number 

 

 

 

 

after correcting the spelling it outputs an error data type error mismatch i dont understand what is the data mismatch

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Nipplemilk909 said:

its accses and its an auto number 

 

 

 

 

after correcting the spelling it outputs an error data type error mismatch i dont understand what is the data mismatch

It probably has to do with this

 

j.Candidate_ID = 2

vs

j.Candidate_ID = '2'

 

Use the correct data type for the column Candidate_ID

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, madknight3 said:

It probably has to do with this

 

j.Candidate_ID = 2

vs

j.Candidate_ID = '2'

 

Use the correct data type for the column Candidate_ID

yep it was thank you!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×