sorting database 's script

Results 1 to 4 of 4

Thread: sorting database 's script

  1. #1
    Join Date
    Dec 1969
    Posts
    147

    Default sorting database 's script

    hi,<BR><BR>i would like to know if there are asp scripts that sort out the database by names when loading out the datas. Or if there isn&#039t,<BR>does that mean that i had to sort out the datas manually in the microsoft access?<BR><BR>thanks<BR><BR>karen

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: sorting database 's script

    Not sure what you mean here. There is a SQL command called ORDER BY which will arrange data pulled from a database in alphanumeric order. Is that what your after?<BR><BR>So if you wanted to see all the users on list sorted by name use<BR><BR>SELECT * <BR>FROM UserInfo<BR>ORDER BY Name<BR><BR>Hope thats some help.<BR><BR>Pete

  3. #3
    Join Date
    Dec 1969
    Posts
    147

    Default RE: sorting database 's script

    thanks=)<BR><BR>that&#039s exactly what i want:)<BR><BR>karen

  4. #4
    Join Date
    Dec 1969
    Posts
    511

    Default RE: sorting database 's script

    Oh I forgot you can also sort them in descending order as well as the default ascending order. To do use DESC at the end of the ORDER BY statement. So to show the wages of all the user, hight paid first use:<BR><BR>SELECT *<BR>FROM UserInfo<BR>ORDER BY Wage DESC <BR><BR>You don&#039t have to put anything on the end for Ascending order, its consided as the default, although you can if you want, replace DESC with ASC.<BR><BR>Pete


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •