开发者

Query for display two rows in a column

开发者 https://www.devze.com 2023-01-31 01:47 出处:网络
can any one help in this? I have a scenario, after query to DB i will get two rows and it will be always two rows or more than that, but my UI demands to be shown in one row. how can v achieve this ??

can any one help in this? I have a scenario, after query to DB i will get two rows and it will be always two rows or more than that, but my UI demands to be shown in one row. how can v achieve this ???? here is one example

DB structure and the data is being showed in following format

Year | value 1 | value 2

2009 | 2000 | 3000

2010 | 4000 | 5000开发者_StackOverflow

My UI Demands the following.

Year : 2009 | 2010

  value 1 | value 1 
  value 2 | value 2

I did a search and got info it can be achieved using TRANSPOSE rows to column. But i am not getting how to proceed on the same


I believe you could do normal query (i.e. without TRANSPOSE) and process rows in business logic of your application. Achieving this using SQL is a bad idea

0

精彩评论

暂无评论...
验证码 换一张
取 消