Home » SQL & PL/SQL » SQL & PL/SQL » Headings for duplicate columns (SQL Plus)
Headings for duplicate columns [message #424470] Fri, 02 October 2009 08:56 Go to next message
Messages: 1
Registered: October 2009
Junior Member
Hope someone can help me:
I'm developing a report using sql Plus that uses a table containing customer addresses. There are separate rows in the table for the customer's postal and residential addresses and the report has separate columns for each address type.

I'm already able to identify and select the different addresses (table a is Postal b is Residential) but I need different column headings for what is effectively the same field name.

How do I go about this ?
Re: Headings for duplicate columns [message #424473 is a reply to message #424470] Fri, 02 October 2009 09:37 Go to previous message
Messages: 12817
Registered: September 2008
Location: Rainy Manchester
Senior Member
Alias the fields to different names
SELECT p.address postal_address, r.address residential_address
FROM addresses p, addresses r
WHERE .....

Previous Topic: Which query is faster? (simple query)
Next Topic: regular expression
Goto Forum:

Current Time: Thu Aug 17 08:55:32 CDT 2017

Total time taken to generate the page: 0.79098 seconds