Home » SQL & PL/SQL » SQL & PL/SQL » query no check wrong mapping (Oracle 10g)
query no check wrong mapping [message #573236] Mon, 24 December 2012 10:51 Go to next message
Messages: 11
Registered: December 2012
Junior Member


a single pin code may have 2 states or 2 districts or 2 cities.

like ex: Chandigarh is capital of two states Haryana and Punjab.
suppose pincode of Chandigarh is 160022

now i need a query to find such pincodes that are mapped to two districts or two cities.

Columns: pincode,City,district,state.

data is some thing like

pincode city district state
160022 --Chandigarh -- Chandigarh--haryana
160022 --Chandigarh -- Chandigarh--punjab


15321--rameshwaram --rameshwaram-- tamilnadu
15321--rameshwaram --madurai-- tamilnadu

now i need to find such data from my table

please help me two find such data by providing a query
Re: query no check wrong mapping [message #573237 is a reply to message #573236] Mon, 24 December 2012 11:03 Go to previous messageGo to next message
Messages: 25544
Registered: January 2009
Location: SoCal
Senior Member
Please read and follow the forum guidelines, to enable us to help you:

Re: query no check wrong mapping [message #573238 is a reply to message #573236] Mon, 24 December 2012 11:28 Go to previous messageGo to next message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
From your previous topics:

Michel Cadot wrote on Sun, 16 December 2012 16:16
From your previous topic:

Michel Cadot wrote on Thu, 13 December 2012 20:02
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.

And feeback to those that help you.
I'm still waiting for you in your previous topic.

rajmighty972 wrote on Thu, 13 December 2012 20:06
Thanks Michel..will follow accordingly...

Are you a liar?


Re: query no check wrong mapping [message #573242 is a reply to message #573238] Mon, 24 December 2012 15:41 Go to previous message
Messages: 21131
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It appears that a query which utilizes GROUP BY and HAVING clauses might do the job.
Previous Topic: Insert into oracle table of unix script values.
Next Topic: Select query like operator getting wrong data
Goto Forum:

Current Time: Thu Jul 27 12:25:54 CDT 2017

Total time taken to generate the page: 0.14324 seconds