Wednesday, September 2, 2009

MYSQL

Hi,
Here is MYSQL Query to find
1) Number of occurance of a substring in a string.
SELECT length(" '123' ,'234','345' ")-length(REPLACE(" '123' ,'234','345' ")-, ',' , '' )) into no_of_commas;
Out put : 2

2) Equilvalent to dbms_output.put_line in MYSQL is
select "some smaple text" ;

3) To view the SP in the console.
SHOW CREATE PROCEDURE

No comments: