1. Miguel Leeuwe
  2. PowerBuilder
  3. Wednesday, 23 November 2022 11:08 AM UTC

Hi, 

I'm trying to do this in Oracle:

SELECT T.emm

 FROM (select '​abc' as emm from dual) T

where T.emm = 'abc'

ORDER BY T.emm;

 

I get no rows. 

When I leave out the WHERE phrase it works. Anyone any idea on why?

I've also tried the same thing with a WITH statement, but results are the same.

(I know this is an oracle question, but I'm still waiting for anyone to reply over there).

Oracle 19c.

 

TIA

MiguelL

Accepted Answer
Andreas Mykonios Accepted Answer Pending Moderation
  1. Wednesday, 23 November 2022 11:22 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Miguel.

Very strange. Where did you typed "select '​abc' as emm from dual"? Your 'abc' has a hidden character just before a.

I execute:

SELECT
    '1st' descr,
    emm
FROM
    (
        SELECT
            '​abc' emm
        FROM
            dual
    ) t
WHERE
    emm = 'abc'
UNION
SELECT
    '2nd'   descr,
    '​abc'  emm
FROM
    dual
ORDER BY
    emm

This strangely returns '?abc'...

Andreas.

Comment
  1. Miguel Leeuwe
  2. Wednesday, 23 November 2022 11:25 AM UTC
Hi Andreas,

I just received the same answer on the Oracle forum and you are right!.

I have no idea how that character has appeared there. I've copied some text from a result set in SQL Developer. That must be the culprit!

Thank you very much, problem solved.

regards,

MiguelL
  1. Helpful 2
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.