Is there a way to convert numbers to circled numbers in Oracle SQL? ( 1 to ① or 20 to ⑳) [closed] - sql

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
Looking for ways to convert numbers to characters.

For SqlServer (which you didn't specify)
SELECT NCHAR(numval+9311);
Explanation:
the "enclosed alphanumerics" are at Unicode codepoints 9312 ① through 9331 ⑳. A "numval" of 1 becomes 9312 before passing it to NCHAR
the NCHAR function converts from codepoint value to corresponding character
Warning:
This only works for values from 1 to 20 (there is no "circled number 21" and while there does exist a "circled digit zero" ⓪, that's at 9450)

Related

SQL query to return only 11 digit numeric values [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Actual data:
|31345678921|
|56789056789|
|56780345678|
|4567 |
|3456 |
|00678596 |
|03456788453|
|ASA 2344 |
|34565 |
|BBq23 |
|DNF LIMIT |
Required data:
|31345678921|
|56789056789|
|56780345678|
|03456788453|
One method is:
where actual not like '%[^0-9]%' and
len(actual) = 11
That is, the value has no non-digits and is 11 digits long.
Another method is:
where try_convert(numeric(11,0), actual) between 10000000000 and 99999999999
That is, when converted to a numeric, the range suggests that it is 11 digits.
And a third method is:
where actual like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
SQL Server supports character classes with like, so you can just like [0-9] 11 times.

Concatenate fields and eliminate all spaces [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I have to concatenate 10 different fields in the same table. After the field concatenated, I need to eliminate the space between all characters. 30,000
records.
CUSTOMER # FIELD 1 FIELD 3 FIELD 4 FIELD 5 FIELD 6 FIELD XX
,TO BE OR NOT, /THAT IS/ /THE Q/ OR NOT THE_ QUESTION
So, it would like like:
,TOBEORNOT,/THAT IS//THEQ/ORNOTTHE_QUESTION
With concat and replace:
select
replace(concat(field1, field2,....), ' ', '')
from customer
To count the characters use len:
select
len(replace(concat(field1, field2,....), ' ', '')) counter
from customer

SQL Server 2000: how to replace a entry with only the last 2 characters [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a table in a SQL Server 2000 database with a column with several entries like 01-03, 04-05. The first 2 digits are the room number and the last two digits are the bed number.
I want to replace the 01-05, 03-07 etc. with only the bed number. So only the last two charcters have to be in the column.
How do I accomplish this?
Sample data is:
In the column [Bed] with values:
22-01
08-01
09-03
01-16
Result has to be:
01
01
03
16
RIGHT should solve your problem:
SELECT RIGHT(RTRIM(Bed), 2) FROM tbl

Select a part of a selected item in sql [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can I possibly select a part of a row data in MS Sql?
ex. Charmina (Female)
All I want to select is the Female not the whole Charmina (Female)
Try this
select substring('Charmina (Female)',
charindex('(','Charmina (Female)')+1,
LEN('Charmina (Female)')-charindex('(','Charmina (Female)')-1)
or
select stuff('Charmina (Female)',1,charindex('(','Charmina (Female)')-1,'')
You may Use SUBSTRING to get sub sequences of strings
SELECT SUBSTRING( your_Raw ,start , length ) AS Alias
FROM Your_Table

Remove trailing zeros from a decimal column [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
How can I remove the trailing zero from the below table using SQL:
SKU SIZE
ABC 35.000000
QWE 36.000000
RTY 37.000000
VGY 38.000000
Expected results:
SKU SIZE
ABC 35
QWE 36
RTY 37
VGY 38
In sql server cast the column containing decimal values to Int
Select SKU,CAST (Size AS INT)
From tablename
For MySql use integer division function DIV
SELECT SKU,Size DIV 1
From Tablename
I suggest
SELECT sku, int(size)
FROM tablename
It's less typing. ;-)