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



i have three table 1. student (stuid,name) 2. subject (subid,sname,studid) 3. marks (subid,stude..

Answer / 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

More Postgre Interview Questions

Is postgres distributed?

0 Answers  


What is psql?

0 Answers  


What is sequence in postgresql?

0 Answers  


How to get the ddl of a table in postgresql?

0 Answers  


How do I view blob data?

0 Answers  






What is a postgresql cluster?

0 Answers  


What language is postgresql written in?

0 Answers  


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

0 Answers  


Are postgres table names case sensitive?

0 Answers  


How do you remove a foreign key constraint?

0 Answers  


What is pg_catalog in postgres?

0 Answers  


What is the option used in PostgreSQL to increase the number of shared memory buffers shared among the backend processes

0 Answers  


Categories