MySQL Workbench - Counting Specific Rows - mysql-workbench

You know in SQL Developer, let's say a query returned 100 rows. Of those 100 rows you could ctrl shift and highlight just a portion of them then right click on that highlighted section and click count to get a total of the highlighted section. Any way to do that in MySQL Workbench?
On a side note, I can't believe they don't allow line numbering in the results section. It'd be a HUGE help.

Is there no way you could get your query to give you the rows that you are selecting. If you can do it manually I'm pretty sure you can run a query to return the results.

Is there any reason you have to use MySQL Workbench ?
for example HeidiSQL counts the rows you are selecting
When I first installed Mysql, mysql workbench was installed with it but I wasn't convinced, so I installed HeidiSQL and I'm fully satisfied.

Related

Limit number of exported / imported rows in DBeaver

is there a way to limit the number of rows while exporting or imported data in DBeaver?
In my case I have a remote DB2 and I need to import SOME rows of a specific table into a local MySQL DB that I have.
Is there a way to do that?
Thanks
Limiting the number of rows being exported only makes sense if the export wizard knows what rows (e.g. order) to export. Therefore it only makes sense to export the resultset of a query, as opposed to export the actual table with a limiting factor.
This is how you can do this in DBeaver:
Issue a query like SELECT * FROM my_table ORDER BY mycolumn LIMIT n.
Replace n with any integer you like obviously. You may also add
DESC after mycolumn, if only the most recent rows make sense to you.
Run the query.
In the pane with the resultset, locate the button
tooltipped "Export result set to fil or another table". It looks
like a tray with an upward arrow. In DBeaver 7.2.2, it is just left
of the split number and cog buttons.
Run that wizard, selecting "SQL" target type (Export to SQL INSERT statements)
Click Next, and configure any other export preferences (you may leave default too).
The file being exported should content you.

How to increase display length in pg admin tool [duplicate]

This question already has answers here:
pgAdmin III Why query results are shortened?
(2 answers)
Closed 6 years ago.
I have a dumb problem. Basically I just upgraded from pgsql 8.4 to 9.1 and upgrade to pgAdmin 1.20.
I have some tables that have large text fields and in the previous query tool I could query a row and copy-paste the data out of it to modify. In this case, I had a table that stored queries that I could run.
Once I upgraded to the new pgAdmin version, when I use the tool and query a row to pull out the text from a field in that row, it truncates the result and ends with an ellipsis (...).
I tried figuring out how to increase the mem on this so it doesn't truncate after 100 characters or so but couldn't.
Anybody have any ideas??
In pgAdmin options, you can change the length of the field. Do the following,
Go to:
File > Options > Query Tool > Max. characters per column
By default it is 256, you can increase it accordingly.
Hope this helps
Marlon Abeykoon's answer is good, but if you want a one-off output and don't want to change settings, then simply output to a file (two buttons along from the usual green 'go' arrow). This saves the entire output in a csv file.

How to edit an existing query in crystal report

i just can see the SQL query at "Database"->"Show SQL Query". How do I edit it in Crystal Report?
You are looking for Edit Command within the Database Expert ... see the screenshot below.
Go to Database Fields >> Database Expert
Select all the tables required for the report (Selected Tables section)
Go to the tab: Links
Drag and create all the links required to connect the tables links.
Then you can right click on the link and select Link Options
Here you can change your joins and your final SQL query will change accordingly.
For Crystal Reports 14.1.x, use Report (in menu at the top) ==> Selection Formulas ==> Record
Firstly I think you need to provide what version of CR you are using.
Secondly, to the best of my knowledge in Version CR13 using VS2010, you CANNOT hand edit SQL query like it we could in older version of CR.
Only way to change it is to update the links/joins on the tables in the Database Expert and Verify Database. These joins will then reflect when you click "Show SQL query".
Thirdly, there is a way you can control the query yourself, using "SQL Command". The steps to do this is mentioned in the other solution.
First Right Click on Database Fields > Set Datasource Location > Select View which you want to replace with another.
I've recently upgraded to VS 2019 with Crystal Reports for Visual Studio 13 SP25. The right click "Edit Command" option wasn't there for me either but I know it was in the past. However I finally did get it by using a toolbar that was added and a "Select Expert Record" option. The same option should be under the "Report" menu in the full version of Crystal Reports.

pgAdmin III Why query results are shortened?

I've recently installed pgAdmin III 1.18.1 and noticed a strange thing:
Long json query results are shortened to 256 symbols and then ' (...)' is added.
Could someone help me disable this shortening?
Thanks to user Erwin Brandstetter for his answer on Database Administrators.
There is a setting for that in the options: Max characters per column - useful when dealing with big columns. Obviously your setting is 256 characters.
Set it higher or set it to -1 to disable the feature.
in pgadmin (Version 5.4) select
file >> preferences >> Query Tool >> Results grid
and change Resize by data? to false. This will the column be sized to the widest of the datatype or column name.

In SSRS 2008, is there any way to add all dataset fields to a table at once?

I'm working with SSRS for the first time. When adding a table to a report, is there any way to add all fields of a dataset to it at once or does it have to be done individually? Drag & drop, insert column -> right is a pain when there are a lot of fields that are being displayed.
It's a bit of a workaround, but the "Add new report" wizard automatically creates a table with the specified columns and groups from your given dataset. I don't believe there's a way to trigger this functionality from within an existing report, but you could create a "sacrificial" report to get what you're looking for - run through the wizard, generate the table, and copy / paste it into your original report. As long as your datasets are the same, it should work just fine...
Hope this helps.
I have a similar problem as the op and am new to SSRS/BIDS. And, I am updating a previously created report which (for me) is too complex to just quickly re-create using the "wizard generation" as the datasource is a web service (with code-generated web service parameters, lots of calc'd datasource fields, etc). It is faster to just copy the .rdl, delete all, and create the table manually.
I thought I would add that (only a little better than op's method, but nonetheless it is time-saving) you can just drag and drop to populate columns w/o the "right click > insert column > right". Just drag the dataset field to the place you want it in the table and BIDS/SSRS will automatically insert a new column. It also helps to drag the latter columns first (i.e. always inserting a previous column) so you don't have to scroll to the right all the time.
I was looking for the similar thing and I have figured this out. Open your report in Report Builder 3.0 which is a free BI tool by Microsoft. Go to Insert > Table wizzard. Then just follow the wizard steps to generate auto columns. Save and reopen the file in your visual studio, file will refresh itself.
Ved
#Kevin Fisher actually there is no need a workaround. There is way to do this out of the box of Report Builder 3. Open your existing favorite report template. on the tool bar, click on INSERT tab, look for TABLE icon, click on the down-ward arrow at the bottom of the TABLE icon, then choose TABLE WIZARD. Then I guess you know what to do from here. -hope this help.
I agree that there is no way to bring all of the columns over from the data set to a table easily. But I came up with a method that helped me:
Insert a blank table (this usually gives you 3 columns). Then insert columns to the right of the table (right click, Insert Column, To the Right), as many times as you need in order for it to equal the number of columns in your data set.
Once you have all the blank columns created in your table, click inside a table cell box and use the drop-down to select the field. This has the added benefit of allowing you to get the fields in the correct order, since I've noticed that the field names in the dataset don't always appear in the same order as the SQL stored proc output.