i have three table
1. student (stuid,name)
2. subject (subid,sname,studid)
3. marks (subid,studentid,marks)
i want the reslut of how as got max marks in each subject

sudentname,max(marks), name
abc,70,nikitha

Answer Posted / somnath banerjee

select (select studentname from student where stuid=a.studentid) as studentname,marks,(select sname from subject where subid=a.subid) as name from (select subid,studentid,max(marks) from marks group by subid,studentid) a;

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pgadmin used for?

454


How do I view blob data?

459


What type of database is postgres?

440


How to find table creation date in postgresql?

465


What is the command or the option available in postgresql that can be used to retrieve the next SERIAL value from the sequence object?

1031






What is join and how many types of joins?

438


Does postgres cache queries?

452


Is mysql faster than postgresql?

425


What is bigint in postgresql?

477


How do I rename a column in postgresql?

453


What is the purpose of postgresql?

395


What is postgresql service?

477


How do you create a table in pgadmin 4?

429


What is bytea in postgres?

453


What does create schema do?

433