Home » SQL & PL/SQL » SQL & PL/SQL » Kindly rewrite this code
Kindly rewrite this code [message #202683] Fri, 10 November 2006 23:28 Go to next message
selvakumar_82
Messages: 138
Registered: October 2005
Location: chennai
Senior Member
Hi friends,

Anyone can modify the query with out using analytical function,

b coz i have to use in mysql.

Kindly reply me ,

SELECT *
2 FROM ( SELECT LEVEL occurrence
3 , INSTR(source_string, search_string, 1, LEVEL) position
4 FROM ( SELECT '&source' source_string
5 , '&search' search_string
6 FROM dual v
7 ) v
8 CONNECT BY LEVEL <= ( length(source_string) -
9 length( replace(source_string,search_string,'')
10 )
11 )/length(search_string)
12 )
13 /
Enter value for source: I search for search
old 4: FROM ( SELECT '&source' source_string
new 4: FROM ( SELECT 'I search for search' source_string
Enter value for search: search
old 5: , '&search' search_string
new 5: , 'search' search_string

OCCURRENCE position
---------- ----------
1 3
2 14

Regards
Selva
Re: Kindly rewrite this code [message #202760 is a reply to message #202683] Sat, 11 November 2006 19:57 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
The query that you posted does not use an analytic function. This is an Oracle forum. If you want code that will run on MySQL, then you need to post on a MySQL forum. The following is a link to a MySQL forum that has a SysOp that also knows Oracle:


http://www.quest-pipelines.com/pipelines/mysql/index.asp
Re: Kindly rewrite this code [message #202876 is a reply to message #202760] Mon, 13 November 2006 02:35 Go to previous message
selvakumar_82
Messages: 138
Registered: October 2005
Location: chennai
Senior Member
thanx for your valuable reply
Previous Topic: ORA-03113: End of file on communication channel
Next Topic: How to get procedure script from dictioinary table
Goto Forum:
  


Current Time: Fri Dec 09 09:57:57 CST 2016

Total time taken to generate the page: 0.16365 seconds