Well, it is SQL I'm using in a Spectra app!

I have a table with a list of card numbers. As we issue a card we want to
find the next numerically unissued card number and issue it. The table has
about 50,000 rows. What I effectively want to do is:

select * from cards
    where unissued = true
    order by cardnumber

and, if I put this in a cfquery I can say 'Maxrows = 1'. If I use maxrows =
1, will the database engine still have to look through all 50,000 rows to
find the first one, before returning that one to CF server?

In short, how do I find the first unissued card without checking all 50,000
rows?

Thanks in advance,

Alan Ford

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/spectra_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to