Information générale
Catégorie:
Codage, syntaxe et commandes
You can't use recno() with aliases in a SELECT. But you can select first from each table into cursors and do
the final select on the cursors instead of the original tables.
SELECT *, recno() as recno FROM table1 INTO CURSOR cursor1
SELECT *, recno() as recno FROM table2 INTO CURSOR cursor2
SELECT t1.*, t2.* FROM cursor1 as t1 INNER JOIN cursor2 AS t2 ON ...
Vlad
>I need to filter based on the recno() of a certain table. This works fine when selecting from one table, but with a join recno() looks at the wrong table and recno('myTable') just returns the current location of the record pointer. Is this possible? Or how about a select statement that show the recno() for each table in a join:
>
>SELECT recno('table1'),recno('table2') from table 1 join table2 ....
>
>I know this won't work, but is there a way to get what I'm looking for in one SQL statement?
>
>Thanks,
>Marcus.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement