alter table and order by
- From: "charlie" <bucweat@xxxxxxxxx>
- Date: 8 Feb 2007 20:46:49 -0800
Assuming I have a table that has field "ttime" that represents time,
and I want to add a column that contains an index that is corresponds
to sorted ttime. For example
ttime recordnum
-------- -----------------
0.01 1
0.02 2
0.03 3
0.04 4
.... ...
Is "alter table [table] add column recordnum counter order by ttime" a
valid statement for Access? This seems to work in a VB script, but
does not in Access. What's up with that? I've seen somewhere that
Access uses a different version of Jet than the system uses....could
this be causing a problem?
Another way of performing this might be
select ttime,f1,f2,f3 into [new table] from [source table] order by
ttime;
alter table [new table] add column recordnum counter;
Problem here is that after [new table] is created, altering the table
seems to invalidate the "order by". Hence a "select * from [new table]
order by ttime" gives different results than "select * from [new
table] order by recordnum".
charlie
.
- Follow-Ups:
- Re: alter table and order by
- From: Marshall Barton
- Re: alter table and order by
- Prev by Date: Re: How to get this table updated with a result from another query
- Next by Date: Re: Repost 2nd Time
- Previous by thread: problems getting value in crosstab fashion in Sql server 2000
- Next by thread: Re: alter table and order by
- Index(es):