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)
 query needed

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-19 : 11:17:56
Singaram writes "TABLE 1
-------
EMP_SKILLS
----------
EMPNO SKILL_ID
-----------------------
100 SKILL1,SKILL3,SKILL5,SKILL6
200 SKILL2
300 SKILL4,SKILL3,SKILL1
400 SKILL5


TABLE 2
-------
SKILLS
------
SKILL_ID DESC
----------------------
SKILL1 VB
SKILL2 ORACLE
SKILL3 SQL SERVER
SKILL4 JAVA
SKILL5 ASP
SKILL6 XML


I need values as follows
------------------------


EMPNO SKILLS
---------------------------
100 VB
SQL SERVER
ASP
XML

200 ORACLE

300 JAVA
SQL SERVER
VB

400 ASP



Expecting your reply at the earliest.

with regards,
S.Murugappan."

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2002-03-19 : 11:17:56
Is this homework?
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-03-19 : 11:35:37
Surely not! Unless it's a course called "how not to structure your database and then try to use it as a reporting tool"
Seriously, take apart the CSV with a few replaces, and a tally table, keeping the tally value so you retain the ordering of SKILL_ID. Join it to SKILLS, and in the output, suppress the EMPNO if that row does not have the min tally value for that employee.


Go to Top of Page
   

- Advertisement -