Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple SQL
Message
From
13/02/2003 16:36:14
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
13/02/2003 16:32:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00752908
Message ID:
00752911
Views:
17
This message has been marked as a message which has helped to the initial question of the thread.
>Hello all
>
>I want to get this kind of output from a sql statement,
>
>select start,end from counter
>
>in counter.dbf it had this data
>
>start end
>1 5
>6 7
>8 10
>
>but what i want is to add a column block with continious numbers.
>
>block start end
>1 1 5
>2 6 7
>3 8 10
>
>Thanxs for any input

I don't have VFP right now to test, but perhaps you can use two SELECT statements, and recno(), thusly:
select start, end from MyTable;
  order by ...;
  sort by ...;
  into cursor Temp1
select *, recno() from Temp1 into cursor Temp2
If you have a UDF to generate sequential numbers, you could also call that function as part of the SELECT statement. You would have to reset the sequence though, if you use the SELECT statement more than once.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform