How do I get the number of characters in the table

Hi all

I'm writing a query.

Requirement is like this.

You will need to obtain the total number of a character in a table.

Here is an example of data.

There are table T1 that has Column1, Column2, and Column3.

Column1Column2Column3
#*
*&$
(**
*%!

This is I want to get the total number of characters "*" in the table, regardless of the number of columns in this table.

By the sample data above, I should get the count as '5'.

I want to translate is not necessary:

WITH got_columns_123 AS

(

SELECT column1 | Column2 | Column3 AS columns_123

FROM t1

)

SELECT NVL (SUM ((columns_123) - NVL LENGTH (LENGTH (REPLACE (columns_123, ' *')), 0)), 0)

OF got_columns_123;

Tags: Database

Similar Questions

Maybe you are looking for