Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. c#, Linq, Sql

c#, Linq, Sql

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinq
2 Posts 2 Posters 23 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14336809
    wrote on last edited by
    #1

    i need to convert sql expression to linq expression, here is my sql code. select a1.Exam_No,a1.Name,a1.Total_Mark,COUNT (a2.Total_Mark)Total_Rank From Table1 a1, Table1 a2 where a1.Total_Mark < a2.Total_Mark or (a1.Total_Mark = a2.Total_Mark and a1.Name = a2.Name) GROUP BY a1.Name, a1.Exam_No, a1.Total_Mark ORDER BY a1.Total_Mark DESC, a1.Name DESC, a1.Exam_No;

    L 1 Reply Last reply
    0
    • M Member_14336809

      i need to convert sql expression to linq expression, here is my sql code. select a1.Exam_No,a1.Name,a1.Total_Mark,COUNT (a2.Total_Mark)Total_Rank From Table1 a1, Table1 a2 where a1.Total_Mark < a2.Total_Mark or (a1.Total_Mark = a2.Total_Mark and a1.Name = a2.Name) GROUP BY a1.Name, a1.Exam_No, a1.Total_Mark ORDER BY a1.Total_Mark DESC, a1.Name DESC, a1.Exam_No;

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      [LINQ to SQL | Microsoft Docs](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/linq/)

      "(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups