MySQL DISTINCT with Case Sensitive

Tags: March 14, 2019 9:55 AM
0 comments

Goals

We want MySQL distinct to use case sensitive grouping because by default MySQL use case insensitive.

Solution of MySQL DISTINCT case sensitive

We can use binary operator to convert the character set.

SELECT DISTINCT CAST(expr as BINARY)
As an alternative we can just use BINARY.
SELECT BINARY expr

References

Share on Facebook Twitter

Disable Word Wrap on MySQL Shell

Tags: March 8, 2019 8:54 PM
0 comments

Goals

Turn off or disable word wrap on MySQL shell

Solution of Disable Word Wrap on MySQL Shell

We can use external pager such as less to do the job. Pager in MySQL shell actually is a pipe to another program.

mysql> pager less -SFX
PAGER set to 'less -SFX'

That's it. Simple and easy. Now when you have very long output horizontally it will not wrap.

Reference

Share on Facebook Twitter