Can MySQL Workbench display the number of selected rows in the query result grid?
Asked Answered
E

3

5

I'm currently using MySQL Workbench to write very complex SQL Queries. To compare between different approaches, I need to know how many records have been returned by my query very quickly.

So, is there any way I can see the number of records returned by my query in the result grid as soon as I execute it?

I know that I can go to the 'Form Editor' tab and click on next and it will show me something like (2/179). But that's a very tedious process for me.

Entrench answered 5/9, 2016 at 7:59 Comment(2)
You could use a subquery in the SELECT list to return the count of your query in each row (SQLFiddle).Potsdam
@TimBiegeleisen Thanks Tim. I'm aware of this method as well. But first, it's more tedious and second, this won't work in my queries as they are very complex ones.Entrench
T
11

The "Action Output" pane (the bottom vertical pane) has a "Response" column that tells you how many rows were returned.

Turkey answered 14/9, 2016 at 2:37 Comment(2)
I think it has been removed; I have "Action Output, Text output, History output" to choose fromTherapist
The "message" column says X row(s) returnedOran
T
1

Philip Olson's way is a good one; yet another way is look at Query Stats in the same panel:

enter image description here

Rows sent to client is the one of interest; note Rows examined is not, as it shows how many rows the engine read to generate the results. (In this case, the operation was an inner join.)

Tieratierce answered 24/2, 2020 at 7:51 Comment(0)
T
-1

You can find a good solution in last answer of this question: Line numbering in result grid in MySQL Workbench

SET @row_number = 0;

SELECT (@row_number:=@row_number + 1) AS num, col_1 FROM Table
Telephoto answered 28/8 at 10:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.