Skip to main content
Skip table of contents

What about spaces in my data using a union in Oracle and MS Sqlserver

Situation

In datprof Integrate I have some Union queries where the data my or may not contain traling spaces.

I know that the Union statement removes duplicates from the result.

Given this base query:

Select 'A '
union
Select 'A'


Do Oracle and Microsoft treat this the  same?


Answer

No

Consider the code below.

Oracle query

SQL
select 'A '  from dual -- A with trailing space
union
select 'A'  from dual  -- A without trailing space

Result:
A 
A


MSS query

SQL
select 'A ' -- A with trailing space
union
select 'A'  -- A without trailing space

Result:
A 


As you can see Oracle treats  'A ' and 'A' as two distinctive values where MS Sql servers treats them as equal.

Quit a differnce.



integrate

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.