forums › forums › SQLyog › SQLyog: Bugs / Feature Requests › Feature Request: Select Distinct Values For A Column
Tagged: columns, distinct, info tab, object explorer
- This topic is empty.
-
AuthorPosts
-
-
May 19, 2014 at 10:41 am #34937
peterlaursen
ParticipantThanks for your interest in SQLyog.I will not comment on your experiences with Workbench. Over the 10+ years we have co-existed with GUI tools from MySQL/Sun/Oracle as well as from others, we have avoided ‘mud-throwing’ at each others. And we are not the ones who will be changing that.It is also very unlikely that we will do any changes to the INFO tab as proposed. This is mainly for perfomance reasons. Currently INFO tab is populated by fast running SHOW queries (see yourself in the HISTORY tab after selecting the INFO tab what the queries are). What you propose could cause the INFO tab to populate very slowly with large data. All depending on what indexes exist and the storage engine used it could take several minutes (and ‘several’ could be ’20’ or more).What remains is then proposals for the Object Browser. If I understand you propose more content in the context menu of a column object here. This context menu could have entries added like* NOT NULL count* NULL count* DISTINCT count* (more?).. what would then paste a query to the editor that would discover the selected option.Please confirm that I understood and if I overlooked something. -
May 19, 2014 at 10:49 am #34938
peterlaursen
ParticipantActually there could be a single option (‘column statistics’) returning
1) total rows
2) NULL rows
3) NOT NULL rows
4) DISTINCT rows
.. for the column. Maybe for indexes we could then add a option for “index cardinality” in the context menu.
-
May 19, 2014 at 12:41 pm #34939
peterlaursen
ParticipantPlease consider this query:
SELECT
COUNT(*) AS '#rows',
COUNT(`columnname`) AS '#rows NOT NULL',
COUNT(DISTINCT `columnname`) AS '#DISTINCT rows'
FROM `tablename`;Isn’t this basically what you are looking for (without the need to type any tablename or columnname yourself)? -
May 19, 2014 at 5:46 pm #34940
cmm324
MemberHi, sorry for the delay in responding and I completely understand your position re:workbench.
The values from the query you provided could be useful but I was looking for something simpler like this:
SELECT
DISTINCT columnname as distinct_values,
COUNT(*) as occurrences
FROM tablename
GROUP BY distinct_values;
I find myself doing this often when working with table structures that make use of codes or integers for relation tables, like an id or code for a status column.
-
June 2, 2014 at 11:38 am #34941
sathish
MemberHello,
Apologies for the delay in replying. We have added this request in our issue tracker here: https://code.google.com/p/sqlyog/issues/detail?id=2047 but currently this is not in our road map for another few months.
Regards,
Sathish
-
-
AuthorPosts
- You must be logged in to reply to this topic.