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. group by [modified]

group by [modified]

Scheduled Pinned Locked Moved LINQ
1 Posts 1 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.
  • L Offline
    L Offline
    Leblanc Meneses 0
    wrote on last edited by
    #1

    I have a List<CapturedWord> CapturedWord -StartIndex -EndIndex -String I can do a group by StartIndex which gives me: startindexkey -- List<CapturedWord> startindexkey -- List<CapturedWord> startindexkey -- List<CapturedWord> var groups = (from w in words group w by w.StartIndex into g select new { StartIndex = g.Key, Words = g }).ToList(); SELECT * FROM CapturedWord AS c1 id StartIndex EndIndex Word ----------- ----------- ----------- 1 0 6 product 2 1 3 rod 4 3 6 duct 5 0 7 products 6 7 14 specific 7 11 12 if 8 15 16 at 9 15 23 attribute 10 15 24 attributes SELECT c1.StartIndex, COUNT(c1.StartIndex) as cnt FROM CapturedWord AS c1 GROUP BY c1.StartIndex StartIndex cnt ----------- ----------- 0 2 1 1 3 1 7 1 11 1 15 3 I would like instead a group by that provides these numbers and accumulated strings cnt ----------- 4 -- product, products, rod, duct 2 -- specific, if 3 -- at, attribute, attributes

    modified on Saturday, July 25, 2009 9:53 PM

    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