Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
Uncommon SQL – MySQL Question of the Day

Skip to content

Uncommon SQL

19. July 2010
By plogi in general

Hi!
There are some useful SQL structures, which are not so commonly used. For example I like the following syntax:

select * from vending_price where (product_id,valid_from) = (0,'2010-01-09');


It is basically the same than the following, but more compact and easier to read.

select * from vending_price where product_id = 0 and valid_from  =  '2010-01-09';

Comment Feed

No Responses (yet)

You must be logged in to post a comment.