Question: I am trying to add a new recipe to install new packages in my image. I need the next packages libnfc5 libnfc-bin libnfc-examples, I have found these packages in this page: <http://ftp.de.debian.org/debian/pool/main/libn/libnfc/>, so I am using the next commands to install the packages:

* devtool add libnfc5 <http://ftp.de.debian.org/debian/pool/main/libn/libnfc/libnfc5_1.7.1-4+b1_armhf.deb>
* devtool build libnfc5
* devtool deploy-target libnfc5 root@my-ip

I am not sure if is necessary modify the .bb file generate: libnfc5\_1.7.1-4+b1.bb, and one time that I execute deploy-target which is necessary to do in my device, Do I need to install the library?

Answer: 
`PIVOT` relational operator is an option:

Sample data:

```
SELECT *
INTO Company
FROM (VALUES
   (1, 'Frodo B (manager), Gandalf G (director), Batman C (cleaner)'),
   (2, 'John Doe (secretary), Mark Jacobs (manager), Lilly Hopes (director), Rihanna Williams (cleaner), Maddy James (supervisor), Merry Poppins (HR)'),
   (3, 'Rick Ross (cleaner)'),
   (4, 'Orlando Bloom (manager), Keira Knightly (secretary)')
) d (Id, Team)

```

Statement:

```
SELECT *
FROM (
   SELECT c.Id, LTRIM(s.[value]) AS [Name], p.Position
   FROM Company c
   CROSS APPLY STRING_SPLIT(c.Team, ',') s
   JOIN (VALUES
      ('cleaner'), ('director'), ('manager'), ('supervisor'), ('secretary'), ('HR'), ('owner')
   ) p (Position) ON CHARINDEX(p.Position, s.[value]) > 0
) t
PIVOT (
   MAX(Name) 
   FOR Position IN ([cleaner], [director], [manager], [supervisor], [secretary], [HR], [owner])
) p

```

Result:

| Id | cleaner | director | manager | supervisor | secretary | HR | owner |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | Batman C (cleaner) | Gandalf G (director) | Frodo B (manager) |  |  |  |  |
| 2 | Rihanna Williams (cleaner) | Lilly Hopes (director) | Mark Jacobs (manager) | Maddy James (supervisor) | John Doe (secretary) | Merry Poppins (HR) |  |
| 3 | Rick Ross (cleaner) |  |  |  |  |  |  |
| 4 |  |  | Orlando Bloom (manager) |  | Keira Knightly (secretary) |  |  |

For SQL Server versions before 2016 (but with XML support), you may split the stored text using well-known XML technique:

```
SELECT *
FROM (
   SELECT c.Id, LTRIM(s.[value].value('.', 'varchar(1000)')) AS [Name], p.Position
   FROM (
      SELECT *, CAST('<x>' + REPLACE(Team, ',', '</x><x>') + '</x>' AS XML) AS XmlTeam
      FROM Company
   ) c
   CROSS APPLY c.XmlTeam.nodes('./x') s ([value])
   JOIN (VALUES
      ('cleaner'), ('director'), ('manager'), ('supervisor'), ('secretary'), ('HR'), ('owner')
   ) p (Position) ON CHARINDEX(p.Position, s.[value].value('.', 'varchar(1000)')) > 0
) t
PIVOT (
   MAX(Name) 
   FOR Position IN ([cleaner], [director], [manager], [supervisor], [secretary], [HR], [owner])
) p   

```
Recursion is another (knowing that it is limited to 7 iterations):

```
with MyTable as (
select *
from (values 
 (1, 'Frodo B (manager), Gandalf G (director), Batman C (cleaner)')
,(2, 'John Doe (secretary), Mark Jacobs(manager), Lilly Hopes(director), Rihanna Williams (cleaner), Maddy James (supervisor), Merry Poppins (HR)')
,(3, 'Rick Ross (cleaner)')
,(4,'Orlando Bloom (manager), Keira Knightly (secretary)')
) T (Id, Team)
),
RCTE as ( -- Find closing bracket positions
    select Id, FromPos=1 , BctPos=charindex(')',Team), Team from MyTable
    union all
    select R.Id, FromPos=R.BctPos+2, BctPos=charindex(')', M.Team, R.BctPos+1), M.Team 
    from MyTable M 
         inner join
         RCTE R
         on R.Id=M.Id
    where charindex(')',M.Team,R.BctPos+1)>0
),
Parsed as
( select Id, Team, Member=SubString(Team,FromPos,BctPos-FromPos+1)  from RCTE)
select 
  Id
, director=min(case when Member like '%(director)' then left(Member,len(Member)- charindex('(',Member)-1) end)
, cleaner=min(case when Member like '%(cleaner)' then left(Member,len(Member)- charindex('(',Member)-1) end)
, manager=min(case when Member like '%(manager)' then left(Member,len(Member)- charindex('(',Member)-1) end)
, supervisor=min(case when Member like '%(supervisor)' then left(Member,len(Member)- charindex('(',Member)-1) end)
, secretary=min(case when Member like '%(secretary)' then left(Member,len(Member)- charindex('(',Member)-1) end)
, owner=min(case when Member like '%(owner)' then left(Member,len(Member)- charindex('(',Member)-1) end)
from Parsed 
group by id
order by id

```

I assumed that they are all well formed (brackets are correctly opened closed; and blanks are used consistently, etc.