| |

VerySource

 Forgot password?
 Register
Search
View: 899|Reply: 1

How do I count the number of words or words in the varchar field

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 Germany

Post time: 2020-3-2 10:30:01
| Show all posts |Read mode
One field in the table is varchar2, such as
id content
1 "kankan, tingting, zzzz,"
2 "1234, zzzzzz, fffffffffffffff, ooo, zzzz, m,"

I want to find out the number of "," in the content and return the following result

id inumber
1 3
2 6
Reply

Use magic Report

0

Threads

21

Posts

18.00

Credits

Newbie

Rank: 1

Credits
18.00

 China

Post time: 2020-5-22 02:00:02
| Show all posts
Write a function to return a string, the number of
select id, yourfunc (content) from table;
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