Subject selecting some records from table
Author shg_sistemas
Hello, I need to do a simple Selling by Customers report, but the user has to be able to select some of the customers or all of them.

So I have a temp table (on commit delete rows) with a field "ID" and I just copy the IDs of the selected customers to it.

Then I construct my select like this:

select * from invoices
:All_Customers = -1
(select ID
from selected_customers
where invoices.id_customer =

So, if I want all the customers I just set All_Customers = -1

The question is: is that the correct (and *BEST/FASTEST*) way to do it??

Just in case, I use FB2.1