Total row and row range

I posted an email in the repserver newsgroup regarding rs_subcmp and its
inabililty to handle large tables.  My question is this:  can I get the
number of rows in a table AND select a specific number of rows.  I know
that sounds basic, but if I could do this, I could build the rs_subcmp
config files on the file.

The tables continue to grow daily and most have composite keys.

I would like to do this:

select * from price order by hotel_id, capacity_type, price_id, dt,
hotel_unit_type where "row" between 1 and 1000
select * from price order by hotel_id, capacity_type, price_id, dt,
hotel_unit_type where "row" between 1000 and 2000
etc.

Take care.
JCS



0
Jay
9/15/2000 3:56:38 PM
sybase.sqlserver.admin 2338 articles. 0 followers. Follow

3 Replies
702 Views

Similar Articles

[PageSpeed] 32

Jay Schirmacher wrote:
> 
> I posted an email in the repserver newsgroup regarding rs_subcmp and its
> inabililty to handle large tables.  My question is this:  can I get the
> number of rows in a table AND select a specific number of rows.  I know
> that sounds basic, but if I could do this, I could build the rs_subcmp
> config files on the file.

	How accurate do you want to be with the number of rows? A
	"select count()" will be the most accurate, but not the
	fastest. You can use some modulo of the total to workout
	how many sets to select at a time.

> The tables continue to grow daily and most have composite keys.
> 
> I would like to do this:
> 
> select * from price order by hotel_id, capacity_type, price_id, dt,
> hotel_unit_type where "row" between 1 and 1000
> select * from price order by hotel_id, capacity_type, price_id, dt,
> hotel_unit_type where "row" between 1000 and 2000
> etc.

	Note that you'll be selecting row 1000 twice here. You would
	want to select on a numeric key value, in which case you don't
	need the order by. A unique primary key is required, of course.

-am
0
Anthony
9/16/2000 3:34:16 AM
Why don't you use "hotel_id" instead of "row" (there is no such function) 
range as

select * from price order by hotel_id, capacity_type, price_id, dt,
hotel_unit_type where "hotel_id" between 1 and 1000
select * from price order by hotel_id, capacity_type, price_id, dt,
hotel_unit_type where "hotel_id" between 1001 and 2000
etc.

I wish if you had bitmap value functionality and get it resolved.

Cheers,
Yogesh

0
sybase
9/19/2000 6:47:27 AM
Sorry, guess I didn't make myself clear...I'll try again.

To Anthony's comments:  I understand that can do a "select count(*)" to get
the row count of the table.  I could also use sp_spaceused if I didn't want to
be as accurate.  That is useful for finding the total row count, but what I am
not able to do ON THE FLY is break out the table into X rows without building
a multitude of select statements based upon the composite key.  As an example:

CREATE TABLE table_a
(
col1 int NOT NULL,
col2 int NOT NULL,
desc varchar(1) NULL
CONSTRAINT PRIMARY KEY PK_table_a CLUSTERED (col1, col2)
)

INSERT table_a (1,1,"a")
INSERT table_a (1,1,"a")
INSERT table_a (1,1,"a")
INSERT table_a (1,1,"a")
INSERT table_a (1,1,"a")
INSERT table_a (1,1,"a")

0
Jay
9/20/2000 11:31:21 PM
Reply:

Similar Artilces:

RE: Resend (Complete)
Sorry, guess I didn't make myself clear in the first message...I'll try again. Also sorry about sending the incomplete message. To Anthony's comment: I understand that can do a "select count(*)" to get the row count of the table. I could also use sp_spaceused if I didn't want to be as accurate. That is useful for finding the total row count, but what I am not able to do ON THE FLY is break out the table into X rows without building a multitude of select statements based upon the composite key--which are not in a consistent pattern. As an example: ...

Returning n rows, setting start row, total number of rows
Hi, I'm try to find out how ado.net can perform some of the things i am able to do in ado. Here is the scenario: I will be searching a table that may have 1000's of rows. I want to be able to dictate how many rows (page size) to return and what the starting row number is and be able to find out how many total rows would be returned by the query. Using old ado recordsets I was able to get the recordset and get the count or all the rows (.recordcount - ormaybe it was .rowcount) and then jump to the starting position (.absoluteposition). How can I do the equivalent in .net? From loo...

First Row, Next Row, Prior Row, Last Row
I have a SQL Anywhere 7.0 Database, have a table Product_detail which contains Column Name Datatype width Null Default batch_id char(10) No None prod_id Integer No None employee_id Integer No None quantity Integer No None price Numeric (14, 2) No None Its primary key is batch_id I have a Freeform Datawindow with this table I want to provide the first row, next row, prior row and last row Ho...

retrieving from row # to row #.
I have over 750 000 rows to retrieve from a table using a datawindow, but my system can only handle approx 30 000 rows and I would like to start from the end of the table. Is it possible to set the row numbers to retrieve? For example, start the retrieve from row 750 000 and stop at row 720 000. There must be a way. thanks, Vern what backend are you using? <Vern> wrote in message news:6BA241541AAD7F2F0063357385256C40.0063358685256C40@webforums... > I have over 750 000 rows to retrieve from a table using a datawindow, but > my system can only handle approx 30 ...

accessing row by row
first of all sorry if i posted this in a wrong place but i'm new to powerbuilder and i have to develop a program quite quickly ( i only worked with acces until now) i have been provided a excel spreadsheet that contains all coloms and rows from all tables wich i have to insert in a database. The difficulty is that i can't use a datapipeline because i need to use a string function to check in wich table i have to put it: TABLENAME_COLUMNNAME -> i thought about using the string function to find out the right column in the right database. however i don't know how you ...

adding a blank header row /row above the header row
is it possible to add a blank row above the header row in gridview for adding some links and buttons the links will respond to thae data in the grid and the buttons are for login / regisration etc....  if yes how it can be done or how do i achieve it. Its better that u create a table with a single row with columns matching the GridView columns. Set the table width same as the GridView width. This will make the GridView Look as if there is a row above its header.Please do not forget to click Mark As Answer on the post that helped you. Regards,Iam Srikanth Reddy....

I want to select top 3 rows except the first from 4 rows of a Table. It should select from top 2 row,top3 row and top4 row.
 Hi, Let say I've 4 rows in a table. I want to select top 3 rows except the first from 4 rows of a Table. It should select from top 2 row,top3 row and top4 row. Thanks in advance Asghar Ali Mohammed http://www.aliwebdev.com(Web Designer and Developer)Do not forget to "MARK AS ANSWER" on the post that helped you. If you can use Linq, you can use Skip. http://msdn.microsoft.com/en-us/vcsharp/aa336757.aspxThanks, EdMicrosoft MVP - ASP/ASP.NET Hii dear..U can fire the Query select Top(3) from Table1 order by id desc.. "A conclusion is whe...

how to compare rows in the datatable and remove the duplicate rows (before removal of duplicate row i need to append those values to original rows)
Hii.             I have a datatable in that i have some rows.. i need to compare those rows one among the other based on first column only. If its duplicate row i need to append those col values to original row. For example here is the data in the table.: Total - 13 columns Name:     Jan:   Feb:   March:...............................Dec  Phani      2        4          ...

Reduce rows displayed but putting 3 rows in one row
Hi all, I'm using PB6.5. I have an SQL DW that fetch some information from the DB but should display only two columns: a code and a value. Also they are displayed in the trailer of a group if that's actually important. In order to reduce displayed rows count, i would like to display each 3 rows in one row(Code,Value,Code,Value,Code,Value). The question is how can i do that?. I've tried to use computed fields and in the second and third pair values to use code[1],value[1],code[2],value[2] but only the code[1],value[1] are OK(Showing next row's data), the third ...

Arranging data on multiple rows into a sigle row (converting rows into columns)
Hello, I have a survey (30 questions) application in a SQL server db. The application uses several relational tables. The results are arranged so that each answer is on a seperate row: user1   answer1user1   answer2user1   answer3user2   answer1user2   answer2user2   answer3 For statistical analysis I need to transfer the results to an Excel spreadsheet (for later use in SPSS). In the spreadsheet I need the results to appear so that each user will be on a single row with all of that user's answers on...

The row number and offset of each row in the page should have a matching entry in row number table
Is the proper correction for the following to recreate the table BCPout/IN or table to table insert, or just drop and recreate the index? Row number is 0. Is there a way to correct just the data page? Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row number and offset of each row in the page should have a matching entry in row number table; check this page (page#=772121 row#=0 offset in row number table=0) Table Corrupt: The row...

(Fwd) How to loop through a database, row by row, and select and update one row at a time
----- Forwarded message from Troy Mulder <mulderta@gmail.com> ----- Date: Mon, 12 Apr 2010 17:48:37 -0400 From: Troy Mulder <mulderta@gmail.com> To: Tim.Bunce@pobox.com Subject: How to loop through a database, row by row, and select and update one row at a time Hello Tim (is it Dr. Bunce?), My name is Troy Mulder, and I am trying to get a perl script to interface with a PostgreSQL database. I am trying to step through each row of the database, and read one column of the row, and update another column of the row. When I follow the online tutorial a...

How to set the row number and get the row number for ("selected row) in Datagrid
I face a problem that i can't get the selected row of the datagrid in both server side script (VB.net) and client side script (javascript) As i can't use the button column / hyperlink column in the datagrid. Thus , i need to handle the change the background color of the selected row and also to get the selected row number for Update/Delete. Thanks in advance. This depends on how do you perform the selection. Do you want to implement chaning of the SelectedRow at the client side without any postback? If you have no issues with postback, then you can do s little trick here: 1. ...

Dynamically adding a new row & assigning total values of the existing row columns in a grid view
Hi All, My web application has a aspx(C#) file which shows the report data in a  grid view.  the grid has first two coulmns fixed and columns 3 & onwards are dynamically generated. What I want - A new row at the end of grid should be added dynamically which should display the total of each column 3 onwards. Any help would be much appreciated.  Thanks, Srain.     http://aspalliance.com/782 If you need three dynamic columns total to be displayed then declare three Global valibales and In RowDataBound event try like this  If (e.Row.RowTy...

Web resources about - Total row and row range - sybase.sqlserver.admin

Total Telecom - Homepage
Daily telecommunications news for global communications professionals.

Total Nonstop Action Wrestling - Wikipedia, the free encyclopedia
Total Nonstop Action Wrestling (commonly referred to as TNA ) is an American privately controlled organization dealing primarily in professional ...

Canberra total fire ban: High temperatures, dry winds create dangerous conditions
... ACT's firefighters face their most dangerous day so far this summer as strong winds, dry air and high temperatures hit the capital. A total ...

Total fire ban across NSW and ACT as temperatures soar
Total fire bans have been issued for eight areas across southern NSW and also in the ACT, with severe fire danger ratings in place across the ...

Total fire bans across parts of NSW as hot weather leads to fears of bushfires flaring up - DailyTelegraph ...
MUCH of the state is bracing for bushfires today as NSW is hit with strong dry winds and soaring temperatures.

Total fire ban, severe fire danger for Perth Metro area and parts of WA
LIVES and homes are under threat from two separate out-of-control bushfires burning in Western Australia.

Canberra total fire ban: High temperatures, dry winds create dangerous conditions
... ACT's firefighters face their most dangerous day so far this summer as strong winds, dry air and high temperatures hit the capital. A total ...

Snowman Building Total Body Workout
... plank (push up position). From here, alternate lifting one hand off the ground and tapping the top of the base of the snowman. Do 10 taps total ...

Martin O'Malley: "The very last event of the night, we actually had a whopping total of one person show ...
"... but by God, he was glad to see me. So we spent the time with him... So I wasn't surprised that he was uncommitted. But I was glad he took ...

Tim Cook says charges of Apple tax avoidance are 'total political crap'
... that Apple's running a scheme "to pay little or not corporate taxes on $74 billion in revenues held overseas," Cook simply said it's "total ...

Resources last updated: 12/30/2015 5:37:02 PM