Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Support Forums » DBISAM SQL » View Thread |
Messages 1 to 4 of 4 total |
SQL to increment numbers to a result |
Thu, Nov 15 2007 1:55 AM | Permanent Link |
"Adam H." | Hi,
I have a query result that I would like to populate with numbers starting from a certain range. ie: if I execute: select T.Ticket, T.SomeNumber From Tickets T where (A condition exists) I get a result set. What I would like to do to the result set is something in SQL like: incNo := 101; //or whatever I assign Query.First; while not Query.Eof do begin Table.Locate('Ticket', QueryTicket.value); TableSomeNumber := incNo; Table.Post; inc(incNo); Query.next; end; Is it possible to get SQL to increment numbers, or will I need to code it in delphi as above? Thanks & Regards Adam. |
Thu, Nov 15 2007 2:42 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Adam
Have a look at RUNSUM - it might do the job Roy Lambert |
Thu, Nov 15 2007 9:24 AM | Permanent Link |
"Robert" | "Adam H." <ahairsub4@pleaseREMOVEme.jvxp.com> wrote in message news:CFD74A4B-B4A1-42E6-B4D7-FB4FD8F3B7E4@news.elevatesoft.com... > Hi, > > I have a query result that I would like to populate with numbers starting > from a certain range. > The following will give you the sequential numbers select field into memory\temp from customer order by field; optimize table memory\temp; alter table memory\temp last autoinc 100; alter table memory\temp add myautoinc autoinc; select * from memory\temp; Robert |
Thu, Nov 15 2007 6:19 PM | Permanent Link |
"Adam H." | Hi Robert and Roy,
I guess there's more than one way to skin a cat ey? Thank you very much for your help! Got what i need, and all working smoothly! Best Regards Adam. |
This web page was last updated on Saturday, May 4, 2024 at 09:18 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |