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. Database
  4. query in oracle

query in oracle

Scheduled Pinned Locked Moved Database
helpdatabaseoracle
2 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.
  • G Offline
    G Offline
    gauthee
    wrote on last edited by
    #1

    hi, i have formed query using several joins. Now that i want the data to be unique, so thuoght of using 'distinct' but it does not seem to help. There is a column named Id in the query and i dont want this to be duplicated hence i gave select distinct(id), ....... but this showed up some error. when using distict it is applying for the entire row, so its checking for each and evry column. Is it possible to use distinct keyword for one or two coulmns instead for the entire row i.e. all columns

    gauthee

    P 1 Reply Last reply
    0
    • G gauthee

      hi, i have formed query using several joins. Now that i want the data to be unique, so thuoght of using 'distinct' but it does not seem to help. There is a column named Id in the query and i dont want this to be duplicated hence i gave select distinct(id), ....... but this showed up some error. when using distict it is applying for the entire row, so its checking for each and evry column. Is it possible to use distinct keyword for one or two coulmns instead for the entire row i.e. all columns

      gauthee

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      gauthee wrote:

      Is it possible to use distinct keyword for one or two coulmns instead for the entire row i.e. all columns

      No. Adding the DISTINCT keyword specifies that only unique rows can appear in the resultset. You should add a GROUP BY clause to your query and group on the fields where you do not want duplicate values in the resultset.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      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