Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have requirement in Sql Server

My First Table having SkillSet Like .net,mvc,jquery in one of records

and in My Profile Table iam having candidate skillset like mvc/mvc,jquery
based on above value .net,mvc,jquery we have to get the records of profile table..

how can i solve this problem

Pleas help me

Regards,
Syed Khaleel
Posted
Comments
Peter Leow 1-Jan-14 0:34am    
Not enough information. Please provide database schema. Use the "Improve question" button.

Hi Syed,

You could prefer UNION operator[^] to do this.
Like
SQL
SELECT * FROM MyProfileTable WHERE candidateSkillset IN 
( SELECT candidateSkillset FROM MyProfileTable
UNION
SELECT SkillSet FROM SkillSetTable )

Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v3
Comments
[no name] 31-Dec-13 8:18am    
based on requiremnet skills we need to fetch profile records which match skill of requirement.
♥…ЯҠ…♥ 31-Dec-13 8:23am    
Use the above query as sub query, using this query get Profile details. By executing the above query what you get?
♥…ЯҠ…♥ 31-Dec-13 8:27am    
updated my solution, now try and lemme know
Christian Graus 31-Dec-13 19:59pm    
I'm sorry, but this is only going to work if the skillsets are identical. And even then, it's wildly inefficient
The union query is stupid. So is using a subquery. If the skills are in a single string, as in one cell is .net, MVC, jquery, then your database design is crap and needs fixing. You need a table like this:

MyProfileTable
(
ProfileId int,
... whatever else
)

And one like this :

candidateSkillset
(
skillsetId int
)

and one like this:

create table skill
(
skillId int identity,
skill varchar(50)
)

Then one like this:

CandidateSkills
(
skillId int,
candidateId int
)

and one like this:

SkillsetSkill
(
skillsetId int,
SkillId int
)

Then you would do a join where skillsetskill.skillid = candidateskills.skillid.

If you need more info, start by posting the schema of your tables and some sample data. If your database is as broken as I suspect and you can't change it, it can still be done, but it will always be bad.
 
Share this answer
 
Comments
[no name] 2-Jan-14 0:46am    
iam using two tables one is candidate profile table which contains skillset col with value can be .net,mvc,jquery
and client requirement coloumn with skillset col with value can be mvc,.net,jquery
then i have to search records based on requrirement skillset value mvc,.net,jquery i have to get profiles which contains these skills it may not be match exactly but should contain some skills provided in requirment..
Christian Graus 2-Jan-14 3:34am    
As I said, this table design is rubbish. Can you change it ? it will always be a problem if you don't.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900