473,672 Members | 2,493 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Query Result Vertical Display

benchpolo
142 New Member
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 3154
Rabbit
12,516 Recognized Expert Moderator MVP
Don't join the table to itself.
Aug 30 '11 #2
NeoPa
32,569 Recognized Expert Moderator MVP
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
2412
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 way to only query certain recordset at a time?
11
13744
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 01-Aug-2003
8
3788
by: Zero.NULL | last post by:
Following is my table and its content: Year TargetedBudget FirstQuarter SecondQuarter ThirdQuarter ------------- ---------------------- ---------------------- ---------------------- ---------------------- 2000 25000 12000 11000 1000 2001 35000 22000 21000 2000 2002 45000 32000 31000 3000 2003 55000 42000 41000 4000 I want a query which returns the result in this format:
6
2559
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 27/02/78
2
4487
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
3114
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 should be some kind of middle ware. This is our problem: we are executing the same set of SELECT SP/queries hundreds of times, without updating the DB. We would like to cache the result of this SP/queries so the next time somebody runs one of...
1
2589
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. Every dealer reports several customers and I have today a query that sorts out how many customer data each BMW dealer sends in to us. The query is also referring to a startdate and enddate (to be filled in in a messagebox) so that i can choose time...
1
2077
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 at least 3 digits precision (e.g. values might show as 0.123). In a select query, I divide FieldA by FieldB. All results show properly. Then I want to display all records that show values above 0.5. To do so, I
1
1747
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 members.email from members, filestorage where filestorage.author = members.username and FileID = {$id}" ; then execute the query using command below: $result = @mysql_query($query) or die("Error! Query failed: <pre>". mysql_error($dbLink)...
2
3311
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 request, HttpServletResponse response) throws ServletException,IOException{ // List dataList = new ArrayList(); response.setContentType("text/html"); PrintWriter pw = response.getWriter();
0
8851
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8645
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8699
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6261
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4245
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2844
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1842
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.