Showing posts with label query. Show all posts
Showing posts with label query. Show all posts

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

MySQL: Updating Table using UPDATE REPLACE Query

Tags: April 29, 2012 9:31 AM
0 comments

This query is quite helpful when you moving from development machine to production where your table content is full of dozen 'http://localhost/' links.

Syntax

UPDATE [table] SET [column] = REPLACE(
  [column],
  [old_value],
  [new_value]
) WHERE [column] LIKE [old_value];

Share on Facebook Twitter