Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

retrieve first row,third row,fifth row

This is a discussion on retrieve first row,third row,fifth row within the SQL Server forums, part of the Databases category; how to retriave first row,third row,fifth row and so on...

Go Back   Geeks Talk > Databases > SQL Server
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

SQL Server SQL Server is a Database Management System(DBMS) by Microsoft

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-16-2009
Junior Member
 
Join Date: May 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
bDeepak.jsharma is on a distinguished road
retrieve first row,third row,fifth row


how to retriave first row,third row,fifth row and so on
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-16-2009
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: retrieve first row,third row,fifth row

Have you tried anything yet ?
Reply With Quote
  #3 (permalink)  
Old 05-18-2009
Contributing Member
 
Join Date: Apr 2008
Location: Gurgaon
Posts: 43
Thanks: 1
Thanked 3 Times in 3 Posts
sarikagupta is on a distinguished road
Re: retrieve first row,third row,fifth row

your question is not completely clear what exactly you want to retrieve?
Reply With Quote
  #4 (permalink)  
Old 07-09-2009
Contributing Member
 
Join Date: Jun 2009
Location: United States
Posts: 71
Thanks: 0
Thanked 5 Times in 4 Posts
CSOOR is on a distinguished road
Re: retrieve first row,third row,fifth row

Quote:
Originally Posted by bDeepak.jsharma View Post
how to retriave first row,third row,fifth row and so on
For get odd rows :

WITH Table2 AS
(
SELECT Col1,Col2,
ROW_NUMBER() OVER (ORDER BY Col2 ) AS 'RowNo'
FROM Table1
)
SELECT Col1,Col2
FROM Table2
WHERE RowNo % 2 <> 0 ;


-----------------OR--------------------
You can also try

Select Col1,Col2
from Table1
where (( ROW_NUMBER() OVER (ORDER BY Col2 ) ) % 2 ) <> 0



Key point is ROW_NUMBER() function .
Reply With Quote
  #5 (permalink)  
Old 07-11-2009
Junior Member
 
Join Date: Jul 2009
Location: delhi
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
gurukulllll is on a distinguished road
Chating Dilog box

hi
I am working on a online teaching website where I need to add a chating option and a white board for drawing purpose by which a teacher can teach to a student. So please guide me how I can Add these two things on my web site?
please reply soon.........
Reply With Quote
  #6 (permalink)  
Old 07-12-2009
Contributing Member
 
Join Date: Jun 2009
Location: United States
Posts: 71
Thanks: 0
Thanked 5 Times in 4 Posts
CSOOR is on a distinguished road
Re: Chating Dilog box

Quote:
Originally Posted by gurukulllll View Post
hi
I am working on a online teaching website where I need to add a chating option and a white board for drawing purpose by which a teacher can teach to a student. So please guide me how I can Add these two things on my web site?
please reply soon.........
Please send your questions in proper thread, this thread is only for sql server .
Reply With Quote
  #7 (permalink)  
Old 07-19-2009
Junior Member
 
Join Date: Jul 2009
Location: Mumbai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Sheetalyardi is on a distinguished road
Re: retrieve first row,third row,fifth row

Quote:
Originally Posted by bDeepak.jsharma View Post
how to retriave first row,third row,fifth row and so on
For a temporary soln - : use
select * from
(select row_number() row_no, emp_no from employee ) emp
where row_no%2<>0;

Hope this works
Reply With Quote
Reply

  Geeks Talk > Databases > SQL Server

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
retrieve and display DhanaPriya SQL 1 08-12-2008 09:56 AM
Retrieve last record pavankumarpk SQL 8 12-27-2007 06:43 AM
how to retrieve value from html tag manishisarda LoadRunner 1 09-12-2007 02:34 PM
How to retrieve data from SAP chinna.kk Data Warehousing 0 09-04-2007 03:38 PM
Help me retrieve my password joel MY SQL 1 12-19-2006 02:53 AM


All times are GMT -4. The time now is 12:15 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved