Coloplast
asked on
SQL simple query
I have a table with 6 columns.
I would like the query to return rows where column 4 and 6 IS NOT NULL at the same time.
Can you help with a query?
Thanks
I would like the query to return rows where column 4 and 6 IS NOT NULL at the same time.
Can you help with a query?
Thanks
ASKER
Tried that but it still gives me rows with NULL i both columns
>>Tried that but it still gives me rows with NULL i both columns
are you sure that?
if you got blank values in one of those columns, it's a blank value NOT a NULL value.
are you sure that?
if you got blank values in one of those columns, it's a blank value NOT a NULL value.
do you want to return those records with blank values in either column4 or column6 ?
ASKER
If there is a NULL value in both 4 and 6 I don't want it returned
>>If there is a NULL value in both 4 and 6 I don't want it returned
so both must be not NULL, if yes, then try my previous posted SQL:
select * from yourTable where column4 is not null AND column6 is not null
IF either column4 or column6 contains NULL value and want to exclude them, try:
select * from yourTable where column4 is not null OR column6 is not null
so both must be not NULL, if yes, then try my previous posted SQL:
select * from yourTable where column4 is not null AND column6 is not null
IF either column4 or column6 contains NULL value and want to exclude them, try:
select * from yourTable where column4 is not null OR column6 is not null
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Vikas is correct on that.
'Løn nummer' would be referring to a char value, NOT referring to a field name.
'Løn nummer' would be referring to a char value, NOT referring to a field name.
:)
'Løn nummer' is a string
[Løn nummer] or "Løn nummer" refers to the column
'Løn nummer' is a string
[Løn nummer] or "Løn nummer" refers to the column
as an observation, it seems that Ryan Chong provided the correct advice yet is unrewarded
select * from yourTable where column4 is not null and column6 is not null