Home » SQL & PL/SQL » SQL & PL/SQL » Need Sql Query
Need Sql Query [message #578062] Sat, 23 February 2013 20:37 Go to next message
mvrkr44
Messages: 64
Registered: December 2012
Member
I have two tables emp , emp address as below

emp table :

emp_id emp_name,
1 rajesh
2 suresh



emp address table :

emp id emp_addresstype emp address
1 O kukatpally
1 H Hitech
2 O Kolkata
2 H hydar nagar

I need the query to display the Office address & House address & emp id in single query

ex: 1,Kukatally,hitech
2,kolkata,hydarnagr
Re: Need Sql Query [message #578063 is a reply to message #578062] Sat, 23 February 2013 20:40 Go to previous messageGo to next message
BlackSwan
Messages: 22902
Registered: January 2009
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/

have 3 tables in the FROM clause
Re: Need Sql Query [message #578067 is a reply to message #578062] Sun, 24 February 2013 01:16 Go to previous messageGo to next message
Michel Cadot
Messages: 59421
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topics:

Michel Cadot wrote on Wed, 12 December 2012 08:45
Welcome to the forum.

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

With any SQL or PL/SQL question, please, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
...


BlackSwan wrote on Mon, 28 January 2013 06:55
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/


Michel Cadot wrote on Wed, 12 December 2012 08:47
Welcome to the forum.

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.

With any SQL or PL/SQL question, please, Post a working Test case: create table and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.
...


BlackSwan wrote on Sun, 24 February 2013 03:57
Please read and follow the forum guidelines, to enable us to help you:

http://www.orafaq.com/forum/t/88153/0/


In addition, we don't do homework.
Post what you already tried and where you are stuck and we help you to go further.

Regards
Michel




Re: Need Sql Query [message #578083 is a reply to message #578062] Sun, 24 February 2013 06:22 Go to previous message
Solomon Yakobson
Messages: 2049
Registered: January 2010
Senior Member
Either have 3 tables in the FROM clause as BlackSwan suggested or use two table join + CASE + GROUP BY.

SY.
Previous Topic: Need query
Next Topic: How to check table properties? (desc only shows if it is null)
Goto Forum:
  


Current Time: Wed Oct 22 16:45:53 CDT 2014

Total time taken to generate the page: 0.09245 seconds