hi,

table : kisiler

name surname points
----- -------- ----
ali elli 1
ali elli 5
ali elli 5
veli kollu 3
veli kollu 4
adem bacakli 2
ali elli 4


how can i get reqult which has been shown below ? MAX value

ali elli 5
ali elli 5

thanks

Recommended Answers

All 3 Replies

not 100% sure what you are going for, but hopefully one of these will either do it for you or get you going in the right direction


1. this will give you each person and their max

select name,surname,max(points)as mp from kisiler group by name,surname

2. this will give you each person and all instances of their max

select k.* from kisiler k
inner join (select name,surname,max(points)as mp from kisiler group by name,surname) c
on c.name = k.name and c.surname = k.surname and k.points = c.mp

3. this will give you all instance of anyone who got the max points

select * from kisiler  where points = (select max(points) from kisiler)

if you need more help let me know

Thank you very very very much,

You realy give very important eamples. they will help me future.

Thank again.

you're quite welcome

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.