1177
Views
10
Comments
Solved
What is not equal to operator in Outsystems SQL widget?
Question

Hi Folks,
Greetings!

Which is the right NOT EQUAL to operator in SQL? Actually I was tried <> and != for comparison condition check but did not get correct result, always fetched result like = (equal) operator.

Can anybody let me know which operator work for NOT EQUAL to condition check?


Thanks

2023-02-20 18-27-41
Gonçalo Soares
Solution

Since this is a foreign key, it may be nullable and you may be dealing with the dreaded SQL three-value logic, caused by NULL values complicating your conditions.


Try the following:


COALESCE(..) should catch NULL values and convert them to 0, allowing for safe use of the <> operator.

2019-09-11 10-03-50
Meer Imtiyaz Ali

Gonçalo Soares wrote:

Since this is a foreign key, it may be nullable and you may be dealing with the dreaded SQL three-value logic, caused by NULL values complicating your conditions.


Try the following:


COALESCE(..) should catch NULL values and convert them to 0, allowing for safe use of the <> operator.


This worked for me. Thanks Gonçalo Soares


And thanks to all for your good support.



2021-04-08 11-10-22
EFreitas

Hi Meer Imtiyaz,

You can use <> .


Can you share a screenshot?

2019-09-11 10-03-50
Meer Imtiyaz Ali

EFreitas wrote:

Hi Meer Imtiyaz,

You can use <> .


Can you share a screenshot?

Hi EFreitas,
Thanks for your reply.

Please see screenshot of SQL query below


2021-04-08 11-10-22
EFreitas

Have you added the test value to the Submitted input parameter (on test inputs tab)?

2019-09-11 10-03-50
Meer Imtiyaz Ali

EFreitas wrote:

Have you added the test value to the Submitted input parameter (on test inputs tab)?

Actually it is Id of Static entity which is pass for compare id's of other entity data where this id of static entity is foreign key.


2021-04-08 11-10-22
EFreitas

I understood that. But to test the query in Service Studio you need to fill in the test value on Test Inputs.
On SQL query you have 4 tabs (SQL, test inputs, test output, executed sql). I'm referring to the second tab.

Like this:

 

2025-11-19 06-14-01
Miguel Verdasca
Champion

A slightly silly question from my side, but is the input variable type the same as ManagerStatusID?

2025-11-19 06-14-01
Miguel Verdasca
Champion

Do you try this:


SELECT * FROM Customers
WHERE CustomerName NOT LIKE 'a%';

But in this case you want compare Identifiers, so I advise you to see this link:

https://stackoverflow.com/questions/6156979/sql-where-condition-not-equal-to

Cheers,
Nuno Verdasca

2023-02-20 18-27-41
Gonçalo Soares
Solution

Since this is a foreign key, it may be nullable and you may be dealing with the dreaded SQL three-value logic, caused by NULL values complicating your conditions.


Try the following:


COALESCE(..) should catch NULL values and convert them to 0, allowing for safe use of the <> operator.

2019-09-11 10-03-50
Meer Imtiyaz Ali

Gonçalo Soares wrote:

Since this is a foreign key, it may be nullable and you may be dealing with the dreaded SQL three-value logic, caused by NULL values complicating your conditions.


Try the following:


COALESCE(..) should catch NULL values and convert them to 0, allowing for safe use of the <> operator.


This worked for me. Thanks Gonçalo Soares


And thanks to all for your good support.



2025-11-19 06-14-01
Miguel Verdasca
Champion

Another thing:

Don't do: SELECT * FROM.

You have a habit of putting: SELECT {TimeSheet}.* FROM.

Sometimes you get errors because of this.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.