AllExperts > Ingres 
Search      
Ingres
Volunteer
Answers to thousands of questions
 Home · More Ingres Questions · Answer Library  · Encyclopedia ·
More Ingres Answers
Question Library

Ask a question about Ingres
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jean-Pierre Zuate
Expertise
Any questions about database Ingres (owned by Computer Associates then Ingres Corp) : - Ingres 6.4 - OpenINGRES from 1.0 to 2.0 - IngresII from 2.0 to 2.6 - Ingres R3, Ingres 2006 (Open Source version) - All tool around Ingres : ABF, Report Writer, Replicator, OpenROAD (3.5 to 2006), Ingres/NET Ingres/STAR, ...

Experience
16 years of computing experience as :
- AS400 programmer
- AIX / Ingres administrator and developer (OpenROAD and korn shell)
- Ingres DataBase Administrator
- Ingres expert - Data modelisation - ETL - Reporting - Many of Computer Associates sofwares - ITIL / CMDB / Change Management

Organizations
http://lafageconseil.fr

 
   

You are here:  Experts > Computing/Technology > Databases > Ingres > Oracle on Unix Platform

Ingres - Oracle on Unix Platform


Expert: Jean-Pierre Zuate - 11/25/2008

Question
Sir/Madam

   I have huge database.  In that I have a table 'RPLI_DET' columns 'POLICY_NO' and 'KEY_ID'.  In policy_no column I wanted to rectify the uniqueness.
Ex.If a policy_no='R-KT-SK-EA-110001' there will be the same policy_no like'R/KT/SK/EA/110001' or 'R/KT-SK-EA-110001'.  I wanted to know how many policy_no are there as above in rpli_det table.  Matter is very much urgent.  I expect your suggestion as early as possible.
Smt.Indiramni
SA RPLI S K Region
Bangalore-01  

Answer
Hello,

I don't know if Oracle have particular functions to do that (remember I'm an Ingres expert not an Oracle expert) but if I have to do that i will do something like
SELECT DISTINCT
substr(policy_no,1,1), substr(policy_no,3,2), etc,
count(*)
FROM
RPLI_DET
GROUP BY policy_no

If result is not what you expect you can put the result of this select in a transition table (create table ... as select) and then count the rows of this new table.

You problem, If I understant it right, is to eliminate the "-", "/" (and so on) before counting something.

Hope this help you.

Regards,
Jean-Pierre ZUATE
http://lafageconseil.fr

View Follow-Ups    Add to this Answer   Ask a Question


 
User Agreement | Privacy Policy | Kids' Privacy Policy | Help
Copyright  © 2008 About, Inc. AllExperts, AllExperts.com, and About.com are registered trademarks of About, Inc. All rights reserved.