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. .NET (Core and Framework)
  4. Query CSV file using Distinct & Order by

Query CSV file using Distinct & Order by

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasecsharpc++helpquestion
3 Posts 2 Posters 0 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.
  • T Offline
    T Offline
    T2102
    wrote on last edited by
    #1

    I need to query a csv file with C++ .NET and get a distinct list which is ordered by multiple criterion. If I write regular SQL, then i get the error "order by clause conflicts with distinct". If I use the prefix "SELECT * FROM ( SELECT" and suffix ")", then the order is lost. Is there a simple workaround using SQL or do I need to write my own code to get the distinct list?

    L 1 Reply Last reply
    0
    • T T2102

      I need to query a csv file with C++ .NET and get a distinct list which is ordered by multiple criterion. If I write regular SQL, then i get the error "order by clause conflicts with distinct". If I use the prefix "SELECT * FROM ( SELECT" and suffix ")", then the order is lost. Is there a simple workaround using SQL or do I need to write my own code to get the distinct list?

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

      This appears to be nothing to do with .NET, try the Database forum.

      MVP 2010 - are they mad?

      T 1 Reply Last reply
      0
      • L Lost User

        This appears to be nothing to do with .NET, try the Database forum.

        MVP 2010 - are they mad?

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

        I am using System::Data::OleDb::OleDbConnection. I know SQL; the problem is that some SQL code does not work fully with some .NET providers. I will try the database forum.

        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