|
 |
asp_web_howto thread: order by ---the way they are entered in the db
Message #1 by "taherm@f... on Wed, 13 Feb 2002 15:39:31
|
|
i guess if i dont use order by clause its by default ASC... but what is i
want to display the products from my table as they are entered and not ASC
or DESC...
is this possible , if yes then how can i achieve this...
Please let me know
Thanks Very Much
Message #2 by "Debreceni, David" <Debreceni.David@h...> on Wed, 13 Feb 2002 10:35:47 -0500
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C1B4A4.1BF1EB40
Content-Type: text/plain;
charset="iso-8859-1"
Create an index in your DB and use the order by your index column. That
will show things as they are entered
David Debreceni
Senior Visual Basic/ASP Developer
xxx-xxx-xxxx x 1086
-----Original Message-----
From: taherm@f...
[mailto:taherm@f...]
Sent: Wednesday, February 13, 2002 10:40 AM
To: ASP Web HowTo
Subject: [asp_web_howto] order by ---the way they are entered in the db
i guess if i dont use order by clause its by default ASC... but what is i
want to display the products from my table as they are entered and not ASC
or DESC...
is this possible , if yes then how can i achieve this...
Please let me know
Thanks Very Much
$subst('Email.Unsub').
Message #3 by "Drew, Ron" <RDrew@B...> on Wed, 13 Feb 2002 11:31:21 -0500
|
|
If you delete the ORDER BY the results are returned FIFO
-----Original Message-----
From: taherm@f...
[mailto:taherm@f...]
Sent: Wednesday, February 13, 2002 10:40 AM
To: ASP Web HowTo
Subject: [asp_web_howto] order by ---the way they are entered in the db
i guess if i dont use order by clause its by default ASC... but what is
i
want to display the products from my table as they are entered and not
ASC
or DESC...
is this possible , if yes then how can i achieve this...
Please let me know
Thanks Very Much
$subst('Email.Unsub').
Message #4 by "Alfredo Yong" <alfredo_yong_linux@h...> on Wed, 13 Feb 2002 14:48:31 -0500
|
|
I use this in any language. I prefer the explicit, long way because it makes
simpler to port the applicaction to other environment:
1. define an "db_order" column. Autonumber in access, Sequence n PistgreSQL,
other databaseses name this feature in other ways. Else you define it simply
as integer.
2. Each time a new record is added, autonumber is added by 1. If you don't
have the feature, previously you need to query the database ("select
max(db_order)+1 as newOrder from myTable")
3. When displaying the rows, you add the "order by db_order asc"
Have a nice day (and better night)
--
=================================================================
Alfredo_Yong@h...
Freelance Developer - Web systems
Expertise in ASP, DHTML, CSS, jscript, php, SQL & etc.
Available to contract.
<taherm@f...> escribió en el mensaje de noticias
145955@a..._web_howto...
>
> i guess if i dont use order by clause its by default ASC... but what is i
> want to display the products from my table as they are entered and not ASC
> or DESC...
>
> is this possible , if yes then how can i achieve this...
>
> Please let me know
>
> Thanks Very Much
>
>
Message #5 by "Ken Schaefer" <ken@a...> on Fri, 15 Feb 2002 17:23:54 +1100
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <taherm@f...>
Subject: [asp_web_howto] order by ---the way they are entered in the db
: i guess if i dont use order by clause its by default ASC... but what is i
: want to display the products from my table as they are entered and not ASC
: or DESC...
:
: is this possible , if yes then how can i achieve this...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a field such as a datestamp field that holds the date/time that the
record was entered. ORDER BY this field.
I'm hesitant to order by:
a) autonumbers - the purpose of this field is to identify records uniquely,
not to determine the order that the fields where entered in. For example,
autonumbers can be *random*, not just ascending
b) indexed fields - since the order in which fields are indexed depends on
more than just when they were entered, and will vary from DBMS to DBMS and
possibly even versions of a single DBMS
If you want to order something by the date/time that it was entered, then
create a field that stores the date/time entered and order by that.
Cheers
Ken
Message #6 by "Drew, Ron" <RDrew@B...> on Fri, 15 Feb 2002 07:43:49 -0500
|
|
Ken is correct as usual...I use a date stamp field in my application so
I can sort the latest entries first for my guestbook. It works real
well.
-----Original Message-----
From: Ken Schaefer [mailto:ken@a...]
Sent: Friday, February 15, 2002 1:24 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Re: order by ---the way they are entered in the
db
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: <taherm@f...>
Subject: [asp_web_howto] order by ---the way they are entered in the db
: i guess if i dont use order by clause its by default ASC... but what
is i
: want to display the products from my table as they are entered and not
ASC
: or DESC...
:
: is this possible , if yes then how can i achieve this...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Create a field such as a datestamp field that holds the date/time that
the record was entered. ORDER BY this field.
I'm hesitant to order by:
a) autonumbers - the purpose of this field is to identify records
uniquely, not to determine the order that the fields where entered in.
For example, autonumbers can be *random*, not just ascending
b) indexed fields - since the order in which fields are indexed depends
on more than just when they were entered, and will vary from DBMS to
DBMS and possibly even versions of a single DBMS
If you want to order something by the date/time that it was entered,
then create a field that stores the date/time entered and order by that.
Cheers
Ken
$subst('Email.Unsub').
|
|
 |