Home > database >  Query results for display
Query results for display

Time:10-31

The select l.x x_xx lxx_xx, t.x x_xx from
Xx_xx_xx l, xx_xx_xx t
Where t.x x_xx=l.x x_id

And t.x x_xx_id in (' 1 ', '2')
And t.x x_id in (' xx ')
And l.x x_xx='20190901'

How to make the 1 and 2 in two columns show

CodePudding user response:

The
refer to the original poster weixin_45668458 response:
select l.x x_xx, lxx_xx, t.x x_xx from
Xx_xx_xx l, xx_xx_xx t
Where t.x x_xx=l.x x_id

And t.x x_xx_id in (' 1 ', '2')
And t.x x_id in (' xx ')
And l.x x_xx='20190901'

How to make the 1 and 2 in two columns show

At present the results of a query is
X x x 1
X x x 2
The effect of need is
X x x 1 2

CodePudding user response:

Try the pivot

CodePudding user response:

The
Hello World reference 2 floor, response:
try pivot

How to do, and where is it? Thank you very much!

CodePudding user response:

Do you have in this 1, 2 are fixed or something? If fixed directly add a column write down go to, if not get some sample data to see,

CodePudding user response:

The
Hello World reference 4 floor, response:
do you have in this 1, 2 are fixed or something? If fixed directly add a column write down go to, if not get some sample data to see,

How to add columns? I have direct messages send pictures!

CodePudding user response:

I can't see direct messages
Plus fixed column like this:
Select 1 as columns 1, 2 as column 2, the other columns in the table... From the table

CodePudding user response:

Thank you, and finally use Max function to solve
  • Related