Patni Computers written test question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sonia.sardana
    New Member
    • Jul 2006
    • 95

    Patni Computers written test question

    Display roll having lowest marks in minimum 2 subjects?
  • jamesd0142
    Contributor
    • Sep 2007
    • 471

    #2
    Originally posted by sonia.sardana
    Display roll having lowest marks in minimum 2 subjects?
    I think you might need to give a little more detail before anyone is able to help you here...

    Comment

    • amitpatel66
      Recognized Expert Top Contributor
      • Mar 2007
      • 2358

      #3
      Originally posted by sonia.sardana
      Display roll having lowest marks in minimum 2 subjects?
      Lets consider this tables:

      student: studentid,stude ntname,studenta ddress
      marks: studentid,subje ctcode,marks

      Try this:

      Code:
      SELECT s.studentname,s.studentid, x.subjectcode,x.marks FROM
      (SELECT studentid, subjectcode,marks,DENSE_RANK() OVER(PARTITION by subjectcode,ORDER BY marks ASC) rnk FROM marks) x,student s
      WHERE s.studentid = x.studentid

      Comment

      • sonia.sardana
        New Member
        • Jul 2006
        • 95

        #4
        hello james.Its written test paper in patni,,they have given the same question....... .......They have all the questions of this type.....

        If u want to see all the questions, I can send U.
        Reply if u want to see or not............ ........

        Comment

        • sonia.sardana
          New Member
          • Jul 2006
          • 95

          #5
          Thx amit, its not working..Error is there in Query...

          Even i m not able to understand it,............ .Is there any simple way?

          Comment

          Working...