Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Null column query

 
Gil Carvalho
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I 'm aving problem making a query who retrieves all the empty columns

This is my query



With this query i have 0 records, and is wrong

This is my table



What's wrong

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gil,
This part doesn't look right:


Instead, it should be


Also, make sure the columns really are null (vs an empty string.)
 
Gil Carvalho
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your help

But i need the iduser, can't be OR, imagine this cenario, the user wnat to know wich are the records with "idequipamento" is null,
if i put or, the query will show all the records and not only the one's from that iduser, is not right?

thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could be AND. I was guessing as to what the comma meant. It's not typically to see a comma in a where clause. That's all I was trying to point out.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!