Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL 'Like' Query Query Result

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-27 : 09:22:35
Harish writes "I'm using SQL Server 7.0

I am making an advance search option to search out the employees of the organization on the basis of different skillsets and qualifications. For that I have a following table

Table : Emp_Qualification

---------------------------------------------------------
Emp_Code SkillSets Qualification
---------------------------------------------------------
E001 VB,ASP,JSP DCOM,COM MBA,MCA
E002 JavaScript,Vbscript,ASP MBA,BE
E003 Java,Jsp,EJB MCA,B-TECh
E004 Vb,VC++,Java BA,MCA


Now the problem is if I want to select all those people who know java. I write the following statement

Select Emp_Code,SkillSets from Emp_Qualification where SkillSets Like '%Java%'

Above query return me the record containign 'JavaScript'

Similiary I would like to return all those records those qualification is 'BA' and knowing 'JAVA' then I write the following query

Select Emp_Code,SkillSets,Qualification from Emp_Qualification where SkillSets Like '%Java%' and qualification like '%BA%'

This query will also return record of having qualificatin 'MBA' and skillset containing 'JavaScript'

Is there any mehtod to match the exact value with 'Like' Clause in T-SQL Statement

Can anybody enhance the above queries ?

Thanks"
   

- Advertisement -