BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Paradoc local SQL problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop)
View previous topic :: View next topic  
Author Message
b.w
Guest





PostPosted: Wed Jan 10, 2007 4:45 am    Post subject: Paradoc local SQL problem Reply with quote



Hello, I have a Challange here and I can't figure it out.

Select select1.nr as nr, Ansatte as antall,maaned,aarstall from avvik,
ansatte ,select1

where (select1.nr=ansatte.select1) and

(avvik.select1=select1.nr)




group by select1.nr,ansatte,maaned,aarstall

order by select1.nr,ansatte,maaned,aarstall



This return something like this

Nr Ansatte Maaned Aarstall

1 279 10 2006

1 275 11 2006 --------->
keep

2 345 10 2006

2 234 11 2006 ------------>
keep



Maaned = month

Aarstall = year

What I would like are the highest month... only one record record for
each number..



Is there a way to go for only return the highest month for Nr1, and Only
return the highest month for Nr 2 a.s.o

Any suggestion.



B
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (Desktop) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.