473,386 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to find middle row of a table?

Hi Every1,

Actually i want to retrieve the middle row(record) of a table, but i am not able to write any query to get the same..

Also i am not sure whether any function as Rownum in ORACLE that exists in DB2 or not!! If yes then can any one explain in details...

Cheers..
Thanks in advance

Sushanta
Oct 8 '08 #1
1 2918
docdiesel
297 Expert 100+
Hi,

there's a ROW_NUMBER() OVER() functionality in DB2. You could create a view containing this function, e.g.:
Expand|Select|Wrap|Line Numbers
  1. Create View
  2.   schema.v_numbered
  3. as
  4.   Select
  5.     ROW_NUMBER() OVER() as ROWNO,
  6.     id,and,other,columns
  7.   From
  8.     schema.mytable ;
and then search for the row no. ( count(rows) DIV 2 ).

Regards

Doc Diesel
Oct 10 '08 #2

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

Similar topics

3
by: ams | last post by:
A table contains records of Ice Cream flavors. There is a primary id field (INT) and a varchar for flavor. I need to get the row in the very middle of the table, however I can't assume that the...
5
by: Poonam | last post by:
Hi Can we align an image or content vertically middle in a DIV. tks poonam
3
by: Chris Mantoulidis | last post by:
I posted this here one day ago but it seems like it hasn't been put up for some unknown reason. That gives me a chance to say things a bit better in this post. 1st of all let's desribe the...
5
by: luke | last post by:
I need to have two different backgrounds, one on the left and one on the right of the screen, with the main content centered in the browser. This is the code I have come up with <table...
4
by: lindsey.crocker | last post by:
I have this links list with background images set on them which changes when they roll over. The <td> is set valign="middle" however as soon as you apply the rollover to the link, the text jumps...
24
by: shafique | last post by:
Hello, Can anybody have idea as how to find it there exist consective one's in a word/dword using bitwise operatiors in C language. Obviously this can be done by shifting and looping one by...
2
by: windandwaves | last post by:
Hi, I would like to position a site in the "middle" of the screen, both horizontally and vertically. I would do this by having a "wrapper" div with { left: 50%; top: 50%;
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
3
by: jerrygadd | last post by:
Hi can anyone please help? I have a need to make a table of fixed size, containing three rows, where the middle row auto expands to fill the remaining space between the top and bottom rows. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.