» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2006, 08:31 AM
Johan Johan is offline
Junior Member
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Johan is on a distinguished road
Default displaying the row no.??

hi guys,
i am working on mysql platform for a new project. how can i display or see the row no. or the row id. as we have in oracle like
"select rownum,ename,dept from employee" or
"select rowid,ename,dept from employee" in mysq.l i am using mysql ver 5.0 with mysql query browser ver 1.1.2. i have table in which there will frequent addtion of row of values and it has unique primary key but the values are not in the incremental order so when i query the table using the select command the rows are displayed in the order of values not the order in which they were inserted as:

name dateofinsertion

ABC 2006-07-15
CDS 2006-07-12
BZS 2006-07-12
XYZ 2006-07-14

so i not able to know which was inserted first if i order by date then if there are more than one values the same qusetion arises.
thanks in advance! -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-08-2006, 08:35 AM
Saggie Saggie is offline
Senior Member
 
Join Date: Jul 2006
Posts: 155
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 18
Saggie is on a distinguished road
Default

MySQL does not maintain row numbers or track when rows were entered, or maintain any specific row ordering.

You can generate a sequence of numbers at any time like so:

SET @num = 0;

SELECT (@num := @num+1) AS rownum, ename, dept FROM employee;
but this will not necessary have any relationship with how the rows were originally inserted.

Or use timestamps to more accurately log when rows were inserted. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
preventing displaying of pics? kassell Web Hosting Industry 1 12-14-2006 03:13 AM
Page not displaying branson ASP forums and Tips 1 08-22-2006 02:58 PM
displaying wrong username white PHP Programming and Tips 2 08-09-2006 01:23 PM
G displaying title data from dmoz armello Google 3 06-20-2006 02:37 PM
yahoo not displaying the last part of URL michelle Yahoo 3 03-26-2006 09:39 AM


All times are GMT. The time now is 10:54 AM.