dbTalk Databases Forums  

queyr (maximum)

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss queyr (maximum) in the comp.databases.oracle.misc forum.



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

Default queyr (maximum) - 07-22-2003 , 05:57 PM






hi,

I want the transactions and levels which level is maximum and version is
maximum, knowing the version has priority (version > level)

Transaction Level Version code

teti 0 1 A

titi 1 2 A

tuta 0 1 B

tata 1 1 B

toto 0 1 C

tuto 1 1 C





gives:



titi 1 2 A

tata 1 1 B

tuto 1 1 C


The query:
select a.transaction,max(version),max(level), a.code,
from ma_table a
group by a.transaction, a.level


gives wrong results of course.



Thanks for your help




Reply With Quote
  #2  
Old   
Daniel Morgan
 
Posts: n/a

Default Re: queyr (maximum) - 07-22-2003 , 07:35 PM






Max wrote:

Quote:
hi,

I want the transactions and levels which level is maximum and version is
maximum, knowing the version has priority (version > level)

Transaction Level Version code

teti 0 1 A

titi 1 2 A

tuta 0 1 B

tata 1 1 B

toto 0 1 C

tuto 1 1 C

gives:

titi 1 2 A

tata 1 1 B

tuto 1 1 C

The query:
select a.transaction,max(version),max(level), a.code,
from ma_table a
group by a.transaction, a.level

gives wrong results of course.

Thanks for your help
Post what the results should look like. We can't read your mind.

--
Daniel Morgan
http://www.outreach.washington.edu/e...ad/oad_crs.asp
damorgan@x.washington.edu
(replace 'x' with a 'u' to reply)




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 - 2013, Jelsoft Enterprises Ltd.