MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 18th, 2000, 04:22 AM
Condor Condor is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: PK,CN
Posts: 4 Condor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I want to select the data from a table sorting desc of the insert order .
That is I want to use select * from table desc; the standard SQL query.
can I do it??
thanks


I'm sorry for my poor English!

Reply With Quote
  #2  
Old August 18th, 2000, 08:41 AM
christucker2 christucker2 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Posts: 81 christucker2 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
So long as you have some kind of incrementing field for every insert (e.g. an autoincrement key) you can use:
select * from mytable order by my_auto_increment_column DESC;

I don't think there's an equivalent on Oracle's rowid in MySQL, so if you don't have an incrementing column (could be manually incremented, but autoincrement seems more likely) then you can't do it -- in that case, just add such a column.

Reply With Quote
  #3  
Old August 18th, 2000, 09:39 PM
Condor Condor is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: PK,CN
Posts: 4 Condor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks,I got it.
That is : if I have no column to sort,I can't use the order feather;I can't get my data sorted by the desc order they are insterted.
I think this is a little bad.
I love MySQL.

sorry for my poor English.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Can I use select * from table desc?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway