473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Displaying Query Result Vertical Display

benchpolo
142 100+
Expand|Select|Wrap|Line Numbers
  1. SELECT a.claimno
  2.     ,a.diagrefno
  3.     ,a.diag
  4.     ,a.diagdesc
  5.     ,b.diagrefno as diagrefno2 
  6.     ,b.diag as diag2
  7.     ,b.diagdesc as diagdesc2
  8.     ,c.diagrefno as diagrefno3
  9.     ,c.diag as diag3
  10.     ,c.diagdesc as diagdesc3
  11.     ,d.diagrefno as diagrefno4
  12.     ,d.diag as diag4
  13.     ,d.diagdesc as diagdesc4
  14.     ,e.diagrefno as diagrefno5
  15.     ,e.diag as diag5
  16.     ,e.diagdesc as diagdesc5
  17.  
  18. FROM ezcap1.archp.dbo.CLAIM_DIAGS a 
  19. LEFT OUTER JOIN ezcap1.archp.dbo.CLAIM_DIAGS b on a.CLAIMNO=b.CLAIMNO and b.diagrefno = 2
  20. LEFT OUTER JOIN ezcap1.archp.dbo.CLAIM_DIAGS c on a.CLAIMNO=c.CLAIMNO and c.diagrefno = 3
  21. LEFT OUTER JOIN ezcap1.archp.dbo.CLAIM_DIAGS d on a.CLAIMNO=d.CLAIMNO and d.diagrefno = 4
  22. LEFT OUTER JOIN ezcap1.archp.dbo.CLAIM_DIAGS e on a.CLAIMNO=e.CLAIMNO and e.diagrefno = 5
  23. WHERE a.diagrefno = 1
QUESTION
The script above displays data result horizontally. Question? How can I display data vertically?

Thanks.
Aug 30 '11 #1
2 3126
Rabbit
12,516 Expert Mod 8TB
Don't join the table to itself.
Aug 30 '11 #2
NeoPa
32,556 Expert Mod 16PB
As Rabbit says, but also sort by [DiagRefNo].
Aug 31 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lin Ma | last post by:
Greetings, In my search application, user can type a number to search. I use LIKE in my query. If a query result generates over 10,000 recordsets, it may several minutes to run. Is there a...
11
by: Surajit Laha | last post by:
I am firing a query like: SELECT TaskName, StartDate FROMTasks WHERE StartDate >= '01-Aug-2003' Now the result comes as: TaskName StartDate -------------------------- Task1 ...
8
by: Zero.NULL | last post by:
Following is my table and its content: Year TargetedBudget FirstQuarter SecondQuarter ThirdQuarter...
6
by: geronimo_me | last post by:
I have 20 queries that compare fields in one table with fields in another table - the query results are the records that do not match in Table1 and Table2. ie Table1 DOB 28/02/78 Table2 DOB...
2
by: Wei Wang | last post by:
Hi, I want to do a select in dynamic command, something like: TRIGGER FUNCTION DECLARE table_name_suffix text; temp_result RECORD; temp_result2 RECORD;
2
by: Martin Sarsale | last post by:
Dear All: Im looking for solutions (Free Software is better) to do query result caching. Thanks to the people from #postgresql I know that postgres doesn't do that by himself and the solution...
1
by: RookieDan | last post by:
Greetings fellow Accessers! Im new but in Access, but I have some background in different coding. I have a programme loading customer data into Access belonging to BMW dealers in Europe. ...
1
by: Maarten van der Cammen | last post by:
Hi, In a table I have two numeric fields (e.g. FieldA and FieldB). Both fields have double precicion (field size "double"), Format "Fixed" and Decimal places "3" since I want to calculate with...
1
ddtpmyra
by: ddtpmyra | last post by:
how can I capture the query result in PHP? I have two queries below: # Fetch the file information $query ="update filestorage set approved ='Y' where FileID = {$id}"; $query1 ="select...
2
by: reeba | last post by:
I want to store the query result, in an servlet, into an xml file and display the contents of the xml file on the browser...... my code is as follows: public void doPost(HttpServletRequest...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.