[firebird-support] Re: Ordering with nulls first and index usage

2012-12-01 Thread Dmitry Yemanov
01.12.2012 13:02, Mark Rotteveel wrote: > For Firebird 2.x yes, but for Firebird 1.x no: > http://www.firebirdsql.org/file/documentation/reference_manuals/user_manuals/html/nullguide-sorts.html True, I was speaking about ODS 11 and above. Dmitry

Re: [firebird-support] Where condition by column number

2012-12-01 Thread Ann Harrison
On Sat, Dec 1, 2012 at 8:09 AM, Leonardo M. Ramé wrote: > Hi, I'm wondering if there's a way to refer columns by number in WHERE > conditions. > > I need this because I'm creating a generic method to create where > clauses for hopefully ANY query, in FreePascal What you suggest, sir, is blasphe

RE: [firebird-support] Where condition by column number

2012-12-01 Thread Svein Erling Tysvær
>Hi, I'm wondering if there's a way to refer columns by number in WHERE >conditions. > >I need this because I'm creating a generic method to create where clauses >for hopefully ANY query, in FreePascal. > >I need this: > >select col1, col2, colN >from ... >join ... >where > col1 = condition1, co

Re: [firebird-support] Where condition by column number

2012-12-01 Thread Leonardo M . Ramé
On 2012-12-01 10:09:15 -0300, Leonardo M. Ramé wrote: >  > >Hi, I'm wondering if there's a way to refer columns by number in WHERE >conditions. > >I need this because I'm creating a generic method to create where >clauses for hopefully ANY query, in FreePascal. > >I need

RE: [firebird-support] Ordering with nulls first and index usage

2012-12-01 Thread Svein Erling Tysvær
>When I specify ORDER BY A_COLUMN DESC NULLS FIRST, the descending index >created on this column is not used and I get 'natural' in plan. >Is there a possibility to use some index when 'nulls first' is specified. Hi Marcin! I think it may be possible to force using an index, but you have to chan

[firebird-support] Where condition by column number

2012-12-01 Thread Leonardo M . Ramé
Hi, I'm wondering if there's a way to refer columns by number in WHERE conditions. I need this because I'm creating a generic method to create where clauses for hopefully ANY query, in FreePascal. I need this: select col1, col2, colN from ... join ... where col1 = condition1, col2 = condition

Re: [firebird-support] Re: Ordering with nulls first and index usage

2012-12-01 Thread Mark Rotteveel
On 1-12-2012 09:53, Dmitry Yemanov wrote: > 01.12.2012 1:26, Leyne, Sean wrote: >> >> In order for an index to be used for ORDER BY, the sort order much match >> exactly the storage order of the index. > > Correct. > >> All indexes have NULLs stored at the end (ie. not first). > > ASC indices have

[firebird-support] Re: Ordering with nulls first and index usage

2012-12-01 Thread Dmitry Yemanov
01.12.2012 1:26, Leyne, Sean wrote: > > In order for an index to be used for ORDER BY, the sort order much match > exactly the storage order of the index. Correct. > All indexes have NULLs stored at the end (ie. not first). ASC indices have NULLs stored in the beginning, DESC indices have NULLs