db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <karth...@gmail.com>
Subject Re: How to select a random record.
Date Mon, 26 Dec 2005 03:07:38 GMT
Maybe there are other ways to perform this, but the first thing that came to
my mind was to create a
Java stored procedure.  This can use simple Java code to create the logic
needed and return
a result set from the products table based on the categories and a generated
random number.

Syntax for creating procedures:


Hope the above helps.


On 12/25/05, Legolas Woodland <legolas.w@gmail.com> wrote:
> Hi
> Thank you for reading my post.
> I have a Product table and a category table.
> some of products exists in more than one category.
> I should select a random product from product table (a record)  and it
> should be from some certain categories.
> Now the question is :
> What is best solution to select a random product which is in one or more
> categories ( categories are  determined by users ).
> Thank you

View raw message