Home » SQL & PL/SQL » SQL & PL/SQL » Combination of more/less and brackets cause TRUE or FALSE (merged 2) (Oracle DB 12c)
Combination of more/less and brackets cause TRUE or FALSE (merged 2) [message #666074] Thu, 12 October 2017 03:21 Go to next message
isri
Messages: 16
Registered: November 2012
Junior Member
Hello,

I found that different combinations of more/less sign (<>) and brackets as strings cause statement appears TRUE or FALSE:

< with { gives TRUE while with ( gives FALSE
> with { gives FALSE while with ( gives TRUE

-- results <= {
 WITH CAL AS(
	SELECT
		TO_CHAR( LEVEL ) n
	FROM
		DUAL CONNECT BY LEVEL <= 2
) SELECT
	*
FROM
	CAL
WHERE
	n <= '{';

-- no results >= (
 WITH CAL AS(
	SELECT
		TO_CHAR( LEVEL ) n
	FROM
		DUAL CONNECT BY LEVEL <= 2
) SELECT
	*
FROM
	CAL
WHERE
	n <= '(';

-- results >= )
 WITH CAL AS(
	SELECT
		TO_CHAR( LEVEL ) n
	FROM
		DUAL CONNECT BY LEVEL <= 2
) SELECT
	*
FROM
	CAL
WHERE
	n >= ')';

-- no results >= }
 WITH CAL AS(
	SELECT
		TO_CHAR( LEVEL ) n
	FROM
		DUAL CONNECT BY LEVEL <= 2
) SELECT
	*
FROM
	CAL
WHERE
	n >= '}';

Could anyone help with explaining that?

Many thanks and regards
Re: Combination of more/less and brackets cause TRUE or FALSE [message #666076 is a reply to message #666074] Thu, 12 October 2017 03:31 Go to previous messageGo to next message
Alien
Messages: 289
Registered: June 1999
Senior Member
select ascii('1'),ascii('2'),ascii('{'),ascii('(')from dual;
Re: Combination of more/less and brackets cause TRUE or FALSE [message #666078 is a reply to message #666076] Thu, 12 October 2017 03:45 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
And for the complete picture:
http://www.asciichars.com/
Re: Combination of more/less and brackets cause TRUE or FALSE [message #666079 is a reply to message #666078] Thu, 12 October 2017 04:57 Go to previous message
isri
Messages: 16
Registered: November 2012
Junior Member
Oh, no looks so obvious Wink

Many thanks!
Previous Topic: returning collection from a loop and bulk collect
Next Topic: Composite Partitioning
Goto Forum:
  


Current Time: Thu Mar 28 20:47:19 CDT 2024