I am using MySQL and I have a function that will take col data from a table row and return a table function. For example, a function like this:
CREATE FUNCTION [dbo].[wordlongerthan4](
@input text
) returns @result table(
pos int,
word varchar,
)
which will return a word longer than 4char and its position.
I want to make sql something like below
select t.name,wordlongerthan4(t.content) from sometable as t;
in the table
------------------------------------------------------------------
| id | name | content |
------------------------------------------------------------------
|1 | my1 | i love something and nothing |
|2 | my2 | It is a sunny day today |
to get the result:
|name | pos | word |
--------------------------------
|my1 |8 |something |
|my1 |22 |nothing |
|my2 |9 |sunny |
|my2 |20 |today |
How can I write sql? (wordlongerthan4 function already exists, I only need sql!)
source
share