Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
Hi Michael, Le 18/03/2014 20:28, Michael Dykman a écrit : Also, as you currently have it, the expression DATE_SUB(NOW(), INTERVAL 24 is going to be executed once for every single candidate row. I would suggest you temporarily memoize that like so: select into DATE_SUB(NOW(), INTERVAL 24

Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
Hi Morgan, Harald, and all, Thanks for the answers. While reading your answers, I realize one more time this problem does not seem so obvious ... That's why I asked ;) . Beyond the specific case I mentioned, my goal is also to get a general discussion about theorical behaviour of MySQL while

Re: Precedence in WHERE clauses.

2014-03-20 Thread Roy Lyseng
Hi Christophe, On 20.03.14 13:18, Christophe wrote: Hi Michael, Le 18/03/2014 20:28, Michael Dykman a écrit : Also, as you currently have it, the expression DATE_SUB(NOW(), INTERVAL 24 is going to be executed once for every single candidate row. I would suggest you temporarily memoize that

Decode Json in MySQL query

2014-03-20 Thread Sukhjinder K. Narula
Hello, I would like to know if there is a way to decode the json string stored in one of the fields as text without using triggers or stored procedures. What I want to do is is within the query, I would like to get one row per element within the json string. For example: the json string is as

Re: Decode Json in MySQL query

2014-03-20 Thread Karr Abgarian
Hi, you probably want to perform this conversion on your client. There are JSON parser libraries available for Java, PHP and the like. Cheers, Karr On Mar 20, 2014, at 11:35 AM, Sukhjinder K. Narula narula...@gmail.com wrote: Hello, I would like to know if there is a way to decode the

Re: Decode Json in MySQL query

2014-03-20 Thread Kishore Vaishnav
Hi, http://blog.ulf-wendel.de/2013/mysql-5-7-sql-functions-for-json-udf/ This is not the exact solution for you query, but might help you better if you add the libraries. *thanks,* *-- *Kishore Kumar Vaishnav On Thu, Mar 20, 2014 at 11:35 AM, Sukhjinder K. Narula narula...@gmail.comwrote:

Re: Decode Json in MySQL query

2014-03-20 Thread Michael Dykman
Short answer, no. There is nothing in MySQL to facilitate this. In general, storing structured data as a blob (JSON, CSV, XML-fragment, etc..) is an anti-pattern in a relational environment. There are NoSQL solutions that provide the facility: Mongo comes to mind; there are some others, I am