find the max value throw the dlink

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankajprakash
    New Member
    • Feb 2007
    • 70

    find the max value throw the dlink

    Hi

    I have a table which contain the filed

    id, departmentid, sectionid, name




    now i have to find the max id of the same department and section. How can get the max id through the dlink
  • saran23
    New Member
    • Mar 2008
    • 28

    #2
    Originally posted by pankajprakash
    Hi

    I have a table which contain the filed

    id, departmentid, sectionid, name




    now i have to find the max id of the same department and section. How can get the max id through the dlink

    the query is

    Code:
    Select Max(id) from tablename where departmentid=sectionID

    Comment

    • pankajprakash
      New Member
      • Feb 2007
      • 70

      #3
      Originally posted by pankajprakash
      Hi

      I have a table which contain the filed

      id, departmentid, sectionid, name




      now i have to find the max id of the same department and section. How can get the max id through the dlink

      i got the answer

      id = obIncidentDataC ontext.Incident _PersonsInvolve ds.Where(x => x.departmentid == departmentid && x.sectionid ==sectionid).Se lect(x => x.ID).Max();

      Comment

      Working...