Query from field in table with formatting

%3CLINGO-SUB%20id%3D%22lingo-sub-1325259%22%20slang%3D%22en-US%22%3EQuery%20from%20field%20in%20table%20with%20formatting%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1325259%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI%20have%20values%20in%20one%20of%20the%20field%20as%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E(10000%2C'a')%2C(20000%2C'b')%2C(30000%2C't')%2C(40000%2C'r')%2C(50000%2C'U')%2C(60000%2C'W')%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThese%20are%202%20values%20in%20one%20single%20set.%3C%2FP%3E%3CP%3EI%20want%20to%20get%20it%20as%202%20sets%20of%20values.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELike%20(10000%2C20000%2C30000%2C40000%2C50000%2C60000)%3C%2FP%3E%3CP%3Eand%20another%20set%20as%26nbsp%3B('a'%2C'b'%2C't'%2C'r'%2C'U'%2C'W').%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20we%20achieve%20this%20in%20SQL%2FT-SQL%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EMahesh%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi,

I have values in one of the field as below.

 

(10000,'a'),(20000,'b'),(30000,'t'),(40000,'r'),(50000,'U'),(60000,'W')

 

These are 2 values in one single set.

I want to get it as 2 sets of values.

 

Like (10000,20000,30000,40000,50000,60000)

and another set as ('a','b','t','r','U','W').

 

How can we achieve this in SQL/T-SQL?

 

Regards,

Mahesh

0 Replies