Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
10 Newer Entries Showing entries 31 to 38

Displaying posts with tag: query (reset)

MySQL University for up to 100 attendees
Employee +0 Vote Up -0Vote Down

Yesterday (December 4th), Sergey Petrunia gave a presentation on what's new in MySQL Optimizer. Unfortunately, the slides didn't show up in the Dimdim presentation area, which also means that the recorded session only has Sergey's voice but not the slides. (I've filed a bug in Dimdim's issue tracker.) However, Sergey kept referring to slide numbers in his talk, so it should be fairly easy (just not as convenient as usual) to …

  [Read more...]
MySQL Enterprise Monitor documentation public now
Employee +0 Vote Up -0Vote Down

The MySQL Enterprise Monitor continuously monitors MySQL servers and alerts to potential problems before they impact the system. It helps eliminating security vulnerabilities, improves replication, optimizes performance, and more. Its newest feature, Quan (Query Analyzer), helps identify queries that could be tuned to improve performance. Quan enables database administrators to do the work that would otherwise require hours in just minutes, or even seconds, and it provides ongoing statistical information about the performance of your queries.

MySQL Enterprise Monitor is a commercial offering by Sun Microsystems, and so was the documentation. …

  [Read more...]
Random selection, with a bias ...
+0 Vote Up -0Vote Down

Say you want to randomly select your employee of the month, but not so randomly, better, you'd like to give your best employees a bigger chance to be selected based on their rating.This is just an example, you could be randomly displaying ads from your customers, but giving an higher chance to be displayed to those who are paying more, there can be a million other example, but I hope you got the

MySQL – The GROUP_CONCAT() function
+0 Vote Up -0Vote Down

GROUP_CONCAT() function is used to concatenate column values into a single string. It is very useful if you would otherwise perform a lookup of many row and then concatenate them on the client end.

For example if you query:

mysql> SELECT Language FROM CountryLanguage WHERE CountryCode = 'THA';

It outputs:

Language
Chinese
Khmer
Kuy
Lao

To concatenate the values into a …



  [Read more...]
Has them all
+0 Vote Up -0Vote Down

A question that pops up frequently on Devshed forums is "How can I get all products that are available in Red and Green colors?" or "How can I find out which customers bought this book and that CD?", solution is simple and I'll provide an example here, it can be made more complicate at your option, but it all boils down to a where and an having condition.Say we have a table that lists all

Good SQL Querying
+0 Vote Up -0Vote Down

By “Good SQL Querying”, I am not referring to “how to make your queries more perfomant.” I am about to go on a mini-rant about how to make readable and self-documenting SQL queries.

One practice that will get me instantly going on a rant is using a comma join. There is NO reason to do the following:

-- uses the sakila sample database
SELECT first_name, last_name, address
FROM customer,address;

What kind of join did the original author intend? A CROSS JOIN? Or did they really want an INNER JOIN and forget the WHERE clause?

The answer: you do not know for sure; you can only guess. Had the query been

SELECT …
  [Read more...]
Two basic indexing tips ...
+0 Vote Up -0Vote Down

Here are two basic tips for proper indexing ...Don't mess with datatypes, too often people refer to an attribute defining it as one datatype in a table and as another in different tables, this actually prevents index usage in joins (forget about FKs for this time ;)) See an example here. You could declare a function based index as a workaround, but why don't we all try to make it right?Put

My New DB GUI
+0 Vote Up -0Vote Down

I've been playing with various GUIs off and on over the last couple of months. I find that I drop to mysql.exe quite often no matter which tool I use. My favorites until recently have been the MySQL GUI Tools and NaviCat.

I was using the Lite edition of Navicat. I actually started using navicat with postgres a few years ago. I like it but the lite version is limited in some annoying ways. It's nice in that it runs (at …

  [Read more...]
10 Newer Entries Showing entries 31 to 38

Planet MySQL © 1995, 2015, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.