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. Database & SysAdmin
  3. MySQL
  4. Doubt regarding a query

Doubt regarding a query

Scheduled Pinned Locked Moved MySQL
questiondatabasesysadmintutorial
2 Posts 2 Posters 14 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.
  • S Offline
    S Offline
    Super Hornet
    wrote on last edited by
    #1

    I have a doubt regarding writing a query, I have table as below Server ID - Bag ID for example, It has 'n' number of rows here, server id is unique and bag id can be duplicated sometimes. I want to write a query for accessing only bag id's which are not duplicated. How do I frame a query???

    V 1 Reply Last reply
    0
    • S Super Hornet

      I have a doubt regarding writing a query, I have table as below Server ID - Bag ID for example, It has 'n' number of rows here, server id is unique and bag id can be duplicated sometimes. I want to write a query for accessing only bag id's which are not duplicated. How do I frame a query???

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      Hi, I create a table with ServerID and BagID and insert records like this: INSERT INTO tbServer VALUES (1,1), (2,1), (3,2), (4,3), (5,3), (6,4) Here is the query: SELECT DISTINCT BagID FROM tbServer GROUP BY BagID HAVING COUNT(BagID) = 1; I hope this will help you ...

      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