SQL row number

Hi,

I would like to know if it is possible with perl, when we search for a
general 'thing'( i.e search in the database all people that speaks english)
in a MySQL database, what is the row number of the last row that matches the
SELECT statment?
If so can someone show me an example?

I would appreciate
Anthony


0
awards
5/30/2003 4:47:02 PM
perl.beginners 29332 articles. 3 followers. Follow

3 Replies
366 Views

Similar Articles

[PageSpeed] 50

> Hi,

Howdy,

> I would like to know if it is possible with perl, when we search for a =
general 'thing'( i.e search in the database all=20
> people that speaks english) in a MySQL database, what is the row =
number of the last row that matches the SELECT statment?=20
> If so can someone show me an example?

 my($last_row_number) =3D $dbh->selectrow_Array($query);
Now $query just needs to be an sql statement that returns what you want.
Kind of depends on what you mean by last row number, the count of rows? =
('50' in a 50 row return) or
The last unique numeric ID? ( '36637889345873456' in a 50 row return), =
see what I mean? Depends on what=20
You're talking about.


HTH
DMuey
> I would appreciate
> Anthony

0
dmuey
6/2/2003 2:30:50 PM
Hi,

Thank you, What i meant is that
If i search in a table all people that speaks English.
I want mysql to search for the first 10 people that matche the query, then
have an option next to go from the last person to the next 10 people.
Or something better would be
SELECT FROM tablex START FROM PERSON y WHERE language = 'english' LIMIT 10
And I don't know if what i'm looking for is possible or not.

Thanx again,
Anthony


0
awards
6/2/2003 2:45:32 PM
> Thank you, What i meant is that
> If i search in a table all people that speaks English.
> I want mysql to search for the first 10 people that matche the query, =
then have an option next to go from the last person > to the next 10 =
people. Or something better would be SELECT FROM tablex START FROM =
PERSON y WHERE language =3D 'english'=20
> LIMIT 10 And I don't know if what i'm looking for is possible or not.

Yes it's possible. You'll need to visit mysql.com to find out about =
queries that select a certain range of records, search.cpan.org for DBI =
to learn how to use those queries in perl and build your query based on =
what the user selected=20
( back 1 2 _3_ 4 next ) and then build your navigation links based on =
that also.

HTH

DMuey


0
dmuey
6/2/2003 3:16:26 PM
Reply:

Similar Artilces:

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. ...

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...

get row number in a sql
Hi, In ASE 12.0 version,how can I get a sequal row number in a single sql? If the sql is: select DeptID,DeptName from Departments I hope the result set is: sequal no dept id dept name 1 101 Finance 2 102 Human 3 103 IT 4 104 Sale Regards, Michael Zhao How about: select identity(32) as "sequal_no", DeptID, DeptName into #foobar from Departments select * from #foobar order by sequal_no drop table #foobar Michael Zhao wrote: > > Hi, > In ASE 12.0 version,how can I get a sequal row numb...

question on number of rows allowed in SQL
 This is weird b/c I thought there was no limit to the number of rows a table can contain in sql (2000- shared hosting). Im working with SQLExecMS as my interfacte and when I open a table this appears on the bottom:Number of rows: 104 [max 500]Can someone please tell me what this means? Thanks! Now theres trouble busin in from outta state and the D.A. cant get no reliefGonna be a rumble out on the promenade and the gamblin commission hangin on by the skin of its teeth Could it be that you actually opened a View that has TOP 500 clause?Beware of bugs in the above code; I...

the number of rows returned from sql before filter
I would like to include a field in the report to state the number of rows returned from the SQL, but the report has a filter that limited the amount of rows displayed and this changed the number of rows in the primary buffer. For example, the SQL returns 100 rows of data and the Infomaker filter filited out 99 rows. Is there anyway to get a hold of the number 100 and report this as a field in the report? Other than placing a nested report on the report that uses a 'select count(*) from table' (mimicking the sql of the original report) , I don't see a way of doing this....

sql help with number of rows return value
hi,i have a stored procedure like this in SQL server ,it returns proper value if data is there for a given id.But if there is no data,it returns row/rows of NULL value and that is counted towards "number of row returned"..Shouldn't it be like,if there are null values in a row,that row should not be counted towards rows returned value .?Rightnow if no value returned from either of the select,it still returns as 2 rows instead of 0 rows.How do handle this situation in SQL? thanks for your help SELECT     SUM(col1) AS SUM_COL1, SUM(col2) AS SUM_COL2,...

How can I get row number in sql select?
Hi, all. How can I get row numbers in select statement? For example, I have a sql like: select emp_id, emp_name, emp_salary from employee order by emp_id Now, I want to add row numbers in the result set. I know we can add a getrow() expression in datawindow, but I do want to know how to do this in select statement. I'm using sybase 11.0.2, pb6. Best regards. Feng This works in Sybase SQL Anywhere, I'm not sure whether it'll work in Sybase 11.0.2 select number(*), emp_id, emp_name, emp_salary from employee order by emp_id Feng Zhu ...

sql statement for ms access row number
Ok, stuck again and everyone here is so helpful and I try to give help when I can..... I have a for loop to update a table in the access db. And using VB as code behind. For i = 1 To intRowCount 'more code here Sql = "Update tblUser Set fldLogo ='" & strURL _ & "' Where ?????????????? = '" & i & "'" 'more code here Next The ??????????? in the sql is where I just can't find the solution. Now I can add another field to the table, an autoNumber, but the le...

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...

How to get Row Numbers from SQL Express 2005 query?
 Hi,  I'm using SQL Express 2005 and VIsual Studio 2005, and this sounds like it should be easy. I'm trying to return the row numbers of my queries, but if I use the Row_Number() command I get the following error: "The OVER SQL construct or statement is not supported." So, is Row_Number() not supported in SQL Express 2005? If not, how can I return row numbers with my queries? Or, more specifically, how can I return a limited result set from a query (i.e. Return only row number 10-20)? My current command is as follows:  SELECT (SELECT R...

how to select a virtual row of numbers to work with it in SQL statement?
hi, i' m trying to find a way to get a free number for pk in a table. if tried to select "select number(*) nr from BIGTABLE, BIGTABLE x", but i cant say where nr not in MYTABLE. i guess everybody knows that this is not allowed. does anybody know an alternative way to select a free number? pls not (isnull(max(nr),-1)+1) :) thnx and regards, stephan. The best way is DEFAULT AUTOINCREMENT. It's fast, it's reliable, and it doesn't cause concurrency problems. Breck On 15 Feb 2004 22:28:27 -0800, "Stephan Ahlf" <ahlf@svs.de> wrote: ...

How to insert more number of rows into sql server 2005 database at once.
Hi, Good morning to all.My table: User_Group_Map(UserID UNIQUEIDENTIFIER,GroupID UNIQUEIDENTIFIER) Now, I want to write one stored procedure that can insert rows into the above table, but more number of rows at-once. Means, the program should allow multiple insertions without the need to call the stored procedure from front-end more number of times. Can anyone please help me on this... Thanks in advance...Ashok kumar.Ashok kumar Couple of ways with SQL 2000 1. Build up a string with comma delitmed values then get the SQL to split the values up 2. Create an xml doc either by serializ...

Inserting large number of rows in to a table in SQL Server 2005 Database
Hi,    I have datatable it is generating by dynamically having more than 8000 rows   What is the better way to insert this data in to database for a particular table ThanxSubba SurendraIf this helps mark it as answer Check http://www.eggheadcafe.com/articles/20050405.aspor http://dotnetslackers.com/Community/blogs/xun/archive/2008/04/15/sql-bulk-insert-and-ado-net-sqlbulkcopy.aspx Kamran ShahidSr. Software Engineer(MCP,MCAD.net,MCSD.net,MCTS,MCPD.net[web])Netprosys Inc.www.netprosys.comRemember to click "Mark as Answer" on the post that h...

SQL Data displayed row by row
Hi,  I was wondering if it was possible to get some help, what I am trying to do is create a ASP webpage that will display Data from an sql database row by row and if there is no data in one row then it will display a message saying "No Data in row"  Any help would be appreciated  Thanks, Michael   mstoten: I was wondering if it was possible to get some help, what I am trying to do is create a ASP webpage that will display Data from an sql database row by row and if there is no data in one row then it will display a message saying "No Data i...

Web resources about - SQL row number - perl.beginners

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

Number - Wikipedia, the free encyclopedia
A number is a mathematical object used to count , label, and measure . In mathematics , the definition of number has been extended over the years ...

The numbers on why you probably don’t want to buy AppleCare, at least at retail price
... you won’t – and that insurers have the stats on their side. The WSJ uses the example of a broken screen on an iPhone 6 to show how the numbers ...

Yes, It’s the Donald Trump Election, and Here Are the Numbers to Prove it
As 2015 draws to a close, Andrew Tyndall has crunched the numbers on how much coverage the three evening newscasts are giving to the 2016 campaigns. ...

Join digits for big points in Sequence – Connecting Numbers
Sequence - Connecting Numbers 13 Thieves Threes! Two Dots The Mesh Join digits for big points in Sequence – Connecting Numbers is a story ...

Record number of Russians joining ISIS
Fighters from the former Soviet Union are joining ISIS in record numbers, according to a new report.

Report Shows Number Of Foreign Fighters Joining ISIS Has DOUBLED In A Year
'The motivation for people to join violent extremist groups in Syria and Iraq remains more personal than political'

Rising tide? Number of officers charged in shootings tripled this year to 15
... affirms some strategies for police accountability and details how far those strategies have to go, the Baltimore Sun reports that the number ...

‘Galavant’ Season 2 Opening Number Riffs On Renewal, Emmy Snub & Scheduling
Dan Fogelman is keeping the self-deprecating tone of his medieval musical comedy series Galavant intact in a big-scale opening number penned ...

Odd-even number plates: The Kejriwal govt in Delhi deserves cheers, not jeers
Those laughing at the Delhi government's decision to restrict the number of vehicles on roads should know this: The joke is really on them.

Resources last updated: 12/9/2015 8:53:50 PM