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. oracle query

oracle query

Scheduled Pinned Locked Moved Database
questiondatabaseoracletutorial
5 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.
  • S Offline
    S Offline
    sandhya14
    wrote on last edited by
    #1

    hi all, ID NAME 1 aaa 2 bbb 3 4 NULL From this table how to retrieve the records with name <> null or empty using oracle query? i should get the result like this :- 1 aaa 2 bbb how can i do this?

    B 1 Reply Last reply
    0
    • S sandhya14

      hi all, ID NAME 1 aaa 2 bbb 3 4 NULL From this table how to retrieve the records with name <> null or empty using oracle query? i should get the result like this :- 1 aaa 2 bbb how can i do this?

      B Offline
      B Offline
      Baran M
      wrote on last edited by
      #2

      Select ID, NAME from [table name] where NAME IS NOT NULL AND NAME != ""

      Education is not a way to escape poverty — it is a way of fighting it.

      S 1 Reply Last reply
      0
      • B Baran M

        Select ID, NAME from [table name] where NAME IS NOT NULL AND NAME != ""

        Education is not a way to escape poverty — it is a way of fighting it.

        S Offline
        S Offline
        sandhya14
        wrote on last edited by
        #3

        giving error:- PL/SQL: ORA-01741: illegal zero-length identifier

        B 1 Reply Last reply
        0
        • S sandhya14

          giving error:- PL/SQL: ORA-01741: illegal zero-length identifier

          B Offline
          B Offline
          Baran M
          wrote on last edited by
          #4

          That error because of the following statement AND NAME != "" If space is there in the column you can check like this, Name != " "; and oracle treats the empty string ('') as null. refer here[^]

          Education is not a way to escape poverty — it is a way of fighting it.

          S 1 Reply Last reply
          0
          • B Baran M

            That error because of the following statement AND NAME != "" If space is there in the column you can check like this, Name != " "; and oracle treats the empty string ('') as null. refer here[^]

            Education is not a way to escape poverty — it is a way of fighting it.

            S Offline
            S Offline
            sandhya14
            wrote on last edited by
            #5

            thanks for ur reply.. its exactly bcz of the space...i gave like <>' ' it worked...

            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