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. Convert SQL to LINQ

Convert SQL to LINQ

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinq
4 Posts 4 Posters 11 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.
  • D Offline
    D Offline
    divesh12
    wrote on last edited by
    #1

    select SUM(total)
    from MyTax mt1
    inner join (
    select Code,ID,TaxYear,Data,max(date) as FinalDate
    from MyTax
    group by Code,ID,TaxYear,Data) mt2
    on mt1.Code = mt2.Code and mt1.ID = mt2.ID
    and mt1.Data = mt2.Data and mt1.TaxYear = mt2.TaxYear
    and mt1.date = mt2.date

    Sander RosselS T E 3 Replies Last reply
    0
    • D divesh12

      select SUM(total)
      from MyTax mt1
      inner join (
      select Code,ID,TaxYear,Data,max(date) as FinalDate
      from MyTax
      group by Code,ID,TaxYear,Data) mt2
      on mt1.Code = mt2.Code and mt1.ID = mt2.ID
      and mt1.Data = mt2.Data and mt1.TaxYear = mt2.TaxYear
      and mt1.date = mt2.date

      Sander RosselS Offline
      Sander RosselS Offline
      Sander Rossel
      wrote on last edited by
      #2

      What is it exactly that you want? What have you tried? Where are you stuck? We can't help you if you don't ask a question...

      It's an OO world.

      public class Naerling : Lazy<Person>{
      public void DoWork(){ throw new NotImplementedException(); }
      }

      1 Reply Last reply
      0
      • D divesh12

        select SUM(total)
        from MyTax mt1
        inner join (
        select Code,ID,TaxYear,Data,max(date) as FinalDate
        from MyTax
        group by Code,ID,TaxYear,Data) mt2
        on mt1.Code = mt2.Code and mt1.ID = mt2.ID
        and mt1.Data = mt2.Data and mt1.TaxYear = mt2.TaxYear
        and mt1.date = mt2.date

        T Offline
        T Offline
        thatraja
        wrote on last edited by
        #3

        Sorry, we don't spoon-feed. Take a look at this article & try yourself. Learn SQL to LINQ (Visual Representation)[^]

        thatraja

        FREE Code Conversion VB6 ASP VB.NET C# ASP.NET C++ JAVA PHP DELPHI ColdFusion
        HTML Marquee & its alternatives

        Nobody remains a virgin, Life screws everyone :sigh:

        1 Reply Last reply
        0
        • D divesh12

          select SUM(total)
          from MyTax mt1
          inner join (
          select Code,ID,TaxYear,Data,max(date) as FinalDate
          from MyTax
          group by Code,ID,TaxYear,Data) mt2
          on mt1.Code = mt2.Code and mt1.ID = mt2.ID
          and mt1.Data = mt2.Data and mt1.TaxYear = mt2.TaxYear
          and mt1.date = mt2.date

          E Offline
          E Offline
          Emmanuel Medina
          wrote on last edited by
          #4

          As Naerling and thatraja pointed out, there is no question, and we don't spood-feed, read the article thatraja linked, or if you are lazy brain-wise, buy Linqer (or any other SQL to LINQ conversion tool).

          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