dbTalk Databases Forums  

by filtering with diferent

comp.databases.oracle.server comp.databases.oracle.server


Discuss by filtering with diferent in the comp.databases.oracle.server forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
valigula
 
Posts: n/a

Default by filtering with diferent - 05-23-2007 , 10:16 AM






Is it possible to filter duplicates codes by filtering with diferent
dates???

I have a table from where i load into my tables, that table has not
got PK on cod1. When i try to load into my table1 found that there is
a lot of duplicates.

So i am trying to group then as:

if date1 is not null then return date1 as data1
elseif data2 is not null then return data2 as data2
elseif data3 is not null then return data3 as data3

select distinct cod1, max (data1)
from table
where date1 is not null
group by grouping sets (cod1 , date1 )

this query returns some blanks that i dont know how to manage.

Anyone has any idea ??

Thanks in advance ..
A.


Reply With Quote
  #2  
Old   
valigula
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 10:18 AM








COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007


Reply With Quote
  #3  
Old   
valigula
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 10:25 AM





COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007


Reply With Quote
  #4  
Old   
valigula
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 10:37 AM





COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007


Reply With Quote
  #5  
Old   
Vladimir M. Zakharychev
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:11 AM



On May 23, 7:16 pm, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
Is it possible to filter duplicates codes by filtering with diferent
dates???

I have a table from where i load into my tables, that table has not
got PK on cod1. When i try to load into my table1 found that there is
a lot of duplicates.

So i am trying to group then as:

if date1 is not null then return date1 as data1
elseif data2 is not null then return data2 as data2
elseif data3 is not null then return data3 as data3

select distinct cod1, max (data1)
from table
where date1 is not null
group by grouping sets (cod1 , date1 )

this query returns some blanks that i dont know how to manage.

Anyone has any idea ??

Thanks in advance ..
A.
Just add the primary key and handle exceptions and be done with it.
Constraints are The Good Thing(tm), I don't really understand why
people try to avoid them.

Regards,
Vladimir M. Zakharychev
N-Networks, makers of Dynamic PSP(tm)
http://www.dynamicpsp.com



Reply With Quote
  #6  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:16 AM



On May 23, 10:37 am, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007
Is there some VALID reason you persist in inundating us with this same
message??? You've asked your question and provided this followup 3
times now. This is the surest way to get yourself, and your
questions, ignored.

It is painfully obvious that COD1 contains NULL values; since we don't
know what sort of data this is, or what it represents, it's your task
to determine how to replace these NULLs with usable values.

Stop posting your output to the group; we have three copies of it and
that is two copies too many.


David Fitzjarrell



Reply With Quote
  #7  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:17 AM



On May 23, 10:37 am, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007
Is there some VALID reason you persist in inundating us with this same
message??? You've asked your question and provided this followup 3
times now. This is the surest way to get yourself, and your
questions, ignored.

It is painfully obvious that COD1 contains NULL values; since we don't
know what sort of data this is, or what it represents, it's your task
to determine how to replace these NULLs with usable values.

Stop posting your output to the group; we have three copies of it and
that is two copies too many.


David Fitzjarrell



Reply With Quote
  #8  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:18 AM



On May 23, 10:37 am, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007
Is there some VALID reason you persist in inundating us with this same
message??? You've asked your question and provided this followup 3
times now. This is the surest way to get yourself, and your
questions, ignored.

It is painfully obvious that COD1 contains NULL values; since we don't
know what sort of data this is, or what it represents, it's your task
to determine how to replace these NULLs with usable values.

Stop posting your output to the group; we have three copies of it and
that is two copies too many.


David Fitzjarrell



Reply With Quote
  #9  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:18 AM



On May 23, 10:37 am, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007
Is there some VALID reason you persist in inundating us with this same
message??? You've asked your question and provided this followup 3
times now. This is the surest way to get yourself, and your
questions, ignored.

It is painfully obvious that COD1 contains NULL values; since we don't
know what sort of data this is, or what it represents, it's your task
to determine how to replace these NULLs with usable values.

Stop posting your output to the group; we have three copies of it and
that is two copies too many.


David Fitzjarrell



Reply With Quote
  #10  
Old   
fitzjarrell@cox.net
 
Posts: n/a

Default Re: by filtering with diferent - 05-23-2007 , 11:18 AM



On May 23, 10:37 am, valigula <valig... (AT) gmail (DOT) com> wrote:
Quote:
COD1 DATE1

2006003183015 26/02/2007
23/02/2007
26/02/2007
Is there some VALID reason you persist in inundating us with this same
message??? You've asked your question and provided this followup 3
times now. This is the surest way to get yourself, and your
questions, ignored.

It is painfully obvious that COD1 contains NULL values; since we don't
know what sort of data this is, or what it represents, it's your task
to determine how to replace these NULLs with usable values.

Stop posting your output to the group; we have three copies of it and
that is two copies too many.


David Fitzjarrell



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.