> I want to have a record number. In subquery
> it shuld work like that:
> Query:
>    select t.*
>    from
>      (select recno,lastname from simpsons) t
>    where t.lastname like "S%"
> Result:
>    RecNo     LastName
>      1    -   Simpson
>      6    -   Skiner
>      8    -   Santa's Little Helper
>
> As you can see - rec no should count subquery,
> not the result set.

I'm not sure I understand your question, but if the above beaviour is what
you want can't you simply do the following?

SELECT ROWID,lastname FROM simpsons WHERE lastname LIKE 'S%';

This will return the record number of the matching records in the simpsons
table.

If you want the record number of each record in the result set (i.e. the set
of records that matched the where clause) you could create a tempoarary
table like this;

CREATE TEMP TABLE t AS SELECT lastname FROM simpsons WHERE lastname LIKE
'S%';
SELECT ROWID, * FROM t;

And then drop the table when you are done.

DROP TABLE t;

I hope this helps.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to