Sql queries usng SELECT statement -


i have these table database. table worker has 2 fields 1 of them id_w(number) , other duty(text). worker(id_w,duty)

i want create sql query selects id_w(id of worker) have same duty duty text type field. can me? want use aggregate function none of them helps.

i used temp table example wanting believe:

select duty, stuff((     select ', ' + cast(id_w varchar(max))      #worker      duty = t.duty     xml path(''),type).value('(./text())[1]','varchar(max)')   ,1,2,'') ids #worker t group duty 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -