|
|
|
|
|
|
Re: converting mysql functions to oracle; using java language [message #111811 is a reply to message #111807] |
Mon, 21 March 2005 00:48 |
cjpangilinan
Messages: 5 Registered: March 2005
|
Junior Member |
|
|
one thing more, the match() and against() of mysql, what are their equivalent to Oracle? thanks
here is the code:
select a.blog_dtl_id AS blog_dtl_id, count( a.blog_dtl_id ) AS sum, c.user_name, d.* from BLOG_TRANSACTIONS a, BLOG_DTL b, BLOG_USER c, BLOG_SITE d WHERE b.blog_id = d.blog_id AND d.user_id = c.user_id AND LENGTH(b.blog_image) > 0 AND a.blog_dtl_id = b.blog_dtl_id AND b.blog_dtl_status < 3 AND a.trans_type IN ( 1, 8, 10, 12 ) GROUP BY a.blog_dtl_id ORDER BY sum DESC
select a.*, b.user_name from BLOG_SITE a, BLOG_USER b where MATCH(a.blog_name) AGAINST ('"+query+"') and a.blog_status < 3 and a.user_id = b.user_id order by a.blog_name asc
select a.blog_url, a.date_created, b.user_name, c.blog_dtl_id, c.blog_post_title from BLOG_SITE a, BLOG_USER b, BLOG_DTL c where MATCH(c.blog_post_title) AGAINST ('"+query+"') and a.blog_status < 3 and a.user_id = b.user_id AND a.blog_id = c.blog_id order by c.blog_post_title asc
SELECT blog_url FROM BLOG_SITE ORDER BY RAND() LIMIT 0,1
[Updated on: Mon, 21 March 2005 01:30] Report message to a moderator
|
|
|
Re: converting mysql functions to oracle; using java language [message #111850 is a reply to message #111811] |
Mon, 21 March 2005 06:20 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
First, go to http://otn.oracle.com (Oracle Technology Network) and register yourself. It's free and you'll have access to the Oracle online documentation at http://tahiti.oracle.com. Bookmark the latter, it's worth it.
Now, rand() as such does not exist in Oracle as a built-in function. Oracle has provided the DBMS_RANDOM package instead.
It could help if you would post your Oracle version, but depending on your version, you could do text search via:
- the LIKE operator.
- Oracle Text and a TEXT index and the CONTAINS operator. This requires some work and is not frequently used.
- In 10g, you can do a regular expression search via the REGEXP_LIKE operator.
HTH,
MHE
|
|
|