Re: Triggers In Informix?
Posted in 1995
> 2. Is there anyway that I can cause a SELECT statement to return every > nth row from the rows satisfying the WHERE clause, where n is a parameter I > specify at the time of SELECT? Or equally acceptable to return a random > sample of size n% from the rows satisfying the WHERE clause? Steve, It's a bit clumsy, but you could do this with an ACE report including the following: define variable x smallint variable y smallint variable z char(30) end input prompt for x using "You are selecting every nth row - what is 'n' : " end format on every row let y = y + 1 let z = (y/x) if z matches "*.00*" then print ...... After a bit of lunchtime hacking, I've managed to get this to work on one of my databases. However, I only have access to v 4.10 (SE). If you have something more up to date, there may be a more straightforward way to do this. Cheers, Richard. ----------------------------------------------------------------- | _ /\\ | Richard Thomas | | \\ 0_ | r.thomas@csl.gov.uk | | \\ / | | | oo/ | "20 Regal and a four-pack, | | / \\ | I guess I'm set for the night" | | \\_/ | - "TV Tan" The Wildhearts | -----------------------------------------------------------------