473,769 Members | 5,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there any alternative for ROWNUM and ROWID in mysql??

43 New Member
hi ,
i need to know whether there is any alternative method through which i can get the result of the querries like below in my sql...

Expand|Select|Wrap|Line Numbers
  1. select * from table_name where rownum=1 and rowid not in (select rowid from table_name where rownum<10)
thanks in adwance
Feb 4 '08 #1
3 43896
r035198x
13,262 MVP
hi ,
i need to know whether there is any alternative method through which i can get the result of the querries like below in my sql...

Expand|Select|Wrap|Line Numbers
  1. select * from table_name where rownum=1 and rowid not in (select rowid from table_name where rownum<10)
thanks in adwance
That is not valid MySQL. In mysql you use limit to limit the number of rows returned. Is that what you are looking for or are you looking for oracle alternatives?
Feb 4 '08 #2
debasisdas
8,127 Recognized Expert Expert
ROWNUM and ROWID are Oracle only terms.
These two are pseudo columns not supported in any other database.
Feb 5 '08 #3
Yes, ROWNUM and ROWID are Oracle only terms.
In MYSQL, use this one :

SELECT your_columns FROM your_table LIMIT 1 (or your rows number);
Oct 20 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6205
by: Otto Haldi | last post by:
Hello to all, Could somebody tell me if it's possible to lock a record with PHP when I have a simple MySQL Database by a provider ? Many thanks in advance for your help. Best regards
9
99094
by: Sandy | last post by:
I am trying to do the following: EXEC SQL UPDATE MY TABLE SET COL1 = :newValue WHERE COL1 = 0 AND ROWNUM = 1 ORDER BY COL2; (index on COL1, COL2)
0
1336
by: Jonas Gorauskas | last post by:
I am having this one problem on an app I am writing where it shows the following error on some error trapping that I did: Query failed: Error Number: 1064 Description: You have an error in your SQL syntax near 'ON M.UserID = C.RowID JOIN SRUser AS CC ON M.CoUserID = CC.RowID WHERE M.RowID =' at line 1
4
1835
by: Paul Drummond | last post by:
Hi all, I have no idea where to post questions like this. Just tried sending this message to comp.database but that didn't work - read-only newsgroup or something. So I appologise for posting here - If anyone could refer me to a more apprpriate group I would be grateful. Anyway, in the mean time I am going to ask my question - it is related to C++ afterall! ----
3
2682
by: Zeeshan | last post by:
Hi everybody, How can I get rownum using MySQL queries , In Oracle one can you in this way SELECT rownum as srno, fname FROM tablename suppose If there are 45 records and if i use while for the srno should display 1, 2, 3, ... 45 query like SELECT rownum as srno, fname FROM tablename
5
7314
by: uthuras | last post by:
Machine : AIX 5.2 Product : UDB DB2 Release 8.1 FP4a I have problem loading data into destination table. The data file is huge with more than 6 Million records. This what i have done 1. Export the data into flat file (del format) 2. use the load command to load the data At step 2, i found that there are some errors registered in the load
1
3553
by: RobbGMelenyk | last post by:
The following query: SELECT rownum from(SELECT @rownum:=@rownum+1 rownum, t.*FROM (SELECT @rownum:=0) r, (SELECT Application FROM application_list_1.application_data_table a ORDER BY Application asc ) t) s WHERE Application like '$app%' order by Application asc limit 1 where $app is my search query passed in from an html form. This query
3
44979
by: chitranjan | last post by:
hi all Is postgreSQL supports ROWNUM and ROWID ? -thanks- Chitranjan Singh
0
1810
by: Walt | last post by:
Darta wrote: I haven't read the question in detail, so this may be way off base, but have you considered using rowid instead of rownum? rownum is a psuedo-column that's a bit "slippery", i.e. it's value changes depending on the where clause, so putting it in the where clause can cause unexpected behavior. Rowid doesn't have this problem; it is what it is independent of what you do with the where clause. I generally avoid using...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.