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. Web Development
  3. ASP.NET
  4. Sql query problem

Sql query problem

Scheduled Pinned Locked Moved ASP.NET
databasequestionhelp
4 Posts 3 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.
  • A Offline
    A Offline
    adkalavadia
    wrote on last edited by
    #1

    id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...

    !- F - R - I - E - N - D - S -!

    P G A 3 Replies Last reply
    0
    • A adkalavadia

      id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...

      !- F - R - I - E - N - D - S -!

      P Offline
      P Offline
      padmanabhan N
      wrote on last edited by
      #2

      adkalavadia wrote:

      sorry for posting my question in wrong category...

      yes, this is the wrong post... Answer: select person from table_name group by (bar) having count(*) > 1

      Padmanabhan My Articles: Articles[^] My latest Article: Word Automation[^]

      1 Reply Last reply
      0
      • A adkalavadia

        id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...

        !- F - R - I - E - N - D - S -!

        G Offline
        G Offline
        Gaurav Dudeja India
        wrote on last edited by
        #3

        you can use select person from [table] group by (bar) having count(*) > 1

        1 Reply Last reply
        0
        • A adkalavadia

          id person bar 1 ankur royal 2 ankur wishy 3 punit royal 4 punit wishy 5 ankit royal result will be Ankur punit i want to list person who use more than one bar.how can i do...i want sql query for ms access. sorry for posting my question in wrong category... thank in advance...

          !- F - R - I - E - N - D - S -!

          A Offline
          A Offline
          adkalavadia
          wrote on last edited by
          #4

          I got the solution SELECT person FROM test GROUP BY Person HAVING COUNT( bar ) > 1 thanks....

          !- F - R - I - E - N - D - S -!

          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