Re: [SQL] Increment a sequence by more than one

2007-08-06 Thread Peter Childs
On 03/08/07, Michael Glaesemann [EMAIL PROTECTED] wrote: On Aug 3, 2007, at 15:27 , Erik Jones wrote: Is there actually a requirement that the block of 5000 values not have gaps? Good point. If not, why not make the versioned table's id column default to nextval from the same

Re: [SQL] Increment a sequence by more than one

2007-08-06 Thread Steve Midgley
Hi Peter, I struggled to implement Michael's suggestion to use CACHE in this regard when he made it but after your encouragement I've studied it more and you and he are both totally right - CACHE is designed to do exactly what I want. Here's the sample code so as to put this issue to bed and

Re: [SQL] Best Fit SQL query statement

2007-08-06 Thread Rodrigo De León
On Aug 6, 3:57 am, Kiran [EMAIL PROTECTED] wrote: and if I query on 98456 the result must be 98456, However if I query on 98455 the result must be 9845 and If I query 9849 the result must be 984 SELECT MAX(t1) FROM t1 WHERE '9849' LIKE t1 || '%'; ---(end of

[SQL] Using function like where clause

2007-08-06 Thread Ranieri Mazili
Hello, I have 2 questions. 1) Can I use a function that will return a string in a where clause like bellow? select * from table where my_function_making_where() and another_field = 'another_think' 2) Can I use a function that will return a string to return the list of columns that

Re: [SQL] Using function like where clause

2007-08-06 Thread Michael Glaesemann
On Aug 6, 2007, at 14:44 , Ranieri Mazili wrote: 1) Can I use a function that will return a string in a where clause like bellow? select * from table where my_function_making_where() and another_field = 'another_think' Probably. What have you tried? What does the documentation