Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Special query condition
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01116185
Message ID:
01116439
Views:
12
I would try to re-organize your tables the way Mike has suggested. With the way things are organized now, however, I think the following will work. This was very quick and dirty. It will also be very slow - although that may not matter much if the tables aren't very large
CREATE CURSOR MyTable (id N(2),Skills c(200))
INSERT INTO MyTable VALUES (1,'Visual Basic, Visual Foxpro, Sql Server, Excel')
INSERT INTO MyTable VALUES (2,'Sql Server, Visual Basic, Excel')
INSERT INTO MyTable VALUES (3,'Excel, Visual Foxpro, Access')
INSERT INTO MyTable VALUES (4,'Visual Basic, Sql Server')
INSERT INTO MyTable VALUES (5,'Sql Server, Access')

m.skills = "Sql Server, Visual Basic"
=ALINES(aSkills,STRTRAN(m.skills,",",CHR(13)))
DIME aSkills(ALEN(aSkills,1),1)
CREATE CURSOR needed (skill C(20))
APPEND FROM ARRAY aSkills
REPLACE ALL skill WITH LTRIM(skill)

SELECT myTable.id FROM mytable ,needed ;
 WHERE mytable.skills LIKE "%"+TRIM(needed.skill)+"%";
 GROUP BY myTable.id HAVING COUNT(*) = RECCOUNT('needed')
>Hi All,
>
>I have developed a recruitment software, where resumes are entered and when a vacancy arises , resumes are searched according to the criterias.
>
>Now there is a field (skills c(200)) in the resume table. assume following records in the table
>
>resume id skills
>--------- -------
>1 Visual Basic, Visual Foxpro, Sql Server, Excel
>2 Sql Server, Visual Basic, Excel
>3 Excel, Visual Foxpro, Access
>4 Visual Basic, Sql Server
>5 Sql Server, Access
>
>Now on the search form there is a field for skills and if the user enters
>Sql Server, Visual Basic
>
>so the result set would be as
>
>resume
>*******
>1
>2
>4
>
>is there a way to write a query to get the following result successfully
>
>Thanks in advance
Previous
Reply
Map
View

Click here to load this message in the networking platform