Questions tagged [sql-calc-found-rows]
31 questions
1
vote
1 answer
can't understand a code line about powerbuilder 11.5 's SQLCA
cause the SQLCA is an built in object, i can't find it in my program , and i also can't find of_init_inifile() function too, where can i find it? and how?
in my program(powerbuilder 11.5), i saw a line like…

user8645601
- 97
- 1
- 7
1
vote
1 answer
MySqlDataReader doesnt read my query as if there was no rows returned but PHPMyAdmin return rows with the same query
first time requesting your help here.
I know my title is wrong, i will change it if once we figure what is the issue, at the moment im kinda lost.
Alright there we go first i wanna select all users from my database that are in range of the current…

Sylvain Martens
- 1,306
- 1
- 9
- 14
1
vote
1 answer
Mysql FOUND_ROWS with HAVING statement
EDIT: As it turns out, it appears that the code IS running as intended. It was just a debugging issue. Sorry to disturb!
I'm running a large query that involves several filters and JOINs, and also I'm paginating the results therefore the query was…

user982962
- 21
- 1
- 6
1
vote
0 answers
MySQL stops using index when SQL_CALC_FOUND_ROWS is added
I have a query which is running far slower than it should. I have distilled the problem down to a simple select statement (some fields have been renamed for privacy):
SELECT SQL_NO_CACHE SQL_CALC_FOUND_ROWS id, date_started, date_complete,…

mulllhausen
- 4,225
- 7
- 49
- 71
1
vote
3 answers
SQL_CALC_FOUND_ROWS on UNION to get total row but with LIMIT on sub query
I'm using MySQL and have two separate tables, PRE_REGISTERED and REGISTERED, and I want to query them using UNION to get the whole combine result. I also use limit for pagination. And at the end I want to get the total row using SQL_CALC_FOUND_ROWS…

yodann
- 355
- 5
- 20
1
vote
1 answer
SQL_CALC_FOUND_ROWS not working sometimes
$query->select('SQL_CALC_FOUND_ROWS i.title,i.fulltext,i.shorttext');
$query->from('#__items as i');
$query->where('i.shorttext LIKE "%'.$word.'%");
with this condition everything is right and count of rows is real...for example if it…

user3307827
- 556
- 1
- 7
- 20
1
vote
1 answer
pooled connection + validation query + SQL_CALC_FOUND_ROWS
I have the problem that my web application running on tomcat often drops the following exception:
java.sql.SQLException: Connection already closed
So I want to validate the connection before getting it from the pool by the following config:

TekTimmy
- 3,066
- 2
- 29
- 33
1
vote
1 answer
Mysql fulltext search performance with SQL_CALC_FOUND_ROWS
I'm trying to optimize the performance of some queries in my application.
In one query with multiple joins and a fulltext search I use SQL_CALC_FOUND_ROWS in a first query for pagination.
Unfortunately the performance of the query is very slow,…

iparker
- 51
- 2
0
votes
2 answers
Custom ORDER BY logic in an SQL query
I'm looking for an elegant solution to the following problem:
I currently have a page listing entries ORDER BY date, with a pagination LIMIT. Here's a snippet of my code:
GET['p']) &&…

Val Redchenko
- 580
- 1
- 8
- 20
0
votes
1 answer
FOUND_ROWS() in MariaDB 10
I have a function which needs the number of rows returned by a select. After some googling i found the FOUND_ROWS() function. But i don't think it works:
SELECT * FROM tipfirme LIMIT 20;
SELECT FOUND_ROWS();
because it always returns 1 as the found…
0
votes
1 answer
Issues using function FOUND_ROWS() giving wrong result with join
This is my query.
SELECT SQL_CALC_FOUND_ROWS (FOUND_ROWS() ) as total,
(SELECT GROUP_CONCAT(sp.specialization) FROM DSpecialization_Master dsp LEFT JOIN Specialization_Master sp on sp.id = dsp.specialization
WHERE dsp.profileid = pm.id and…

Archish
- 850
- 8
- 32
0
votes
4 answers
cakephp and SQL_CALC_FOUND_ROWS
I am trying to add the SQL_CALC_FOUND_ROWS into a query (Please note this isn't for pagination)
please note I am trying to add this to a cakePHP query the code I currently have is below:
return $this->find('all', array(
'conditions'…

Lizard
- 43,732
- 39
- 106
- 167
0
votes
1 answer
How to avoid error "Incorrect usage/placement of SQL_CALC_FOUND_ROWS"?
We have in our application two queries, the first very long which takes 30 seconds, and then another to get the number of rows before the LIMIT:
SELECT DISTINCT SQL_CALC_FOUND_ROWS res.*,...GROUP BY...HAVING...ORDER BY fqa_value LIMIT 0,10;
SELECT…

Edward Tanguay
- 189,012
- 314
- 712
- 1,047
0
votes
1 answer
SQL_CALC_FOUND_ROWS + zf2
I am using a simple select statement using SQL_CALC_FOUND_ROWS in zf2. The code would look like as follows and uses quantifier.
$select = $this->getSlaveSql()->select('posts');
$select->quantifier(new…

Laxman
- 1,149
- 2
- 11
- 17
0
votes
0 answers
PHP found_rows query, Would it Collapse With the same simulataneous query?
If I run a query specifying SQL_CALC_FOUND_ROWS so the total numbers of results is given back instead of the limited amount specified in the LIMIT clause, would it collapse (meaning the value of another simultaneous query would be returned instead…

stacker
- 43
- 5