| |

VerySource

 Forgot password?
 Register
Search
Author: skipper

Comma to filter out all data in a column

[Copy link]

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-19 02:15:01
| Show all posts
- Full-width half-width, all can be removed
declare @a varchar(10)
set @a='1, 2, 3,,'
select replace(@a,',','')
-------------------
123

(The number of rows affected is 1 row)
-------------------------------------------------
The test is completely correct. Full-width half-width can be removed.
Reply

Use magic Report

0

Threads

93

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 China

Post time: 2020-6-19 23:30:01
| Show all posts
SQL default sorting is possible
create table ta(name varchar(10)collate Chinese_PRC_CS_AS_WS)--If this sorting method was specified when the table was created
insert ta
select '1, 2, 3,,,'
select replace(replace(name,',',''),',','') from ta--it needs to be removed twice
Reply

Use magic Report

0

Threads

16

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-7-3 21:15:01
| Show all posts
Hahahaha, express excitement, ^_^.
Reply

Use magic Report

0

Threads

49

Posts

35.00

Credits

Newbie

Rank: 1

Credits
35.00

 China

Post time: 2020-7-7 18:15:01
| Show all posts
Support恶魔右指
Reply

Use magic Report

0

Threads

22

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-7-8 22:15:01
| Show all posts
Just replace, hehe
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list