Fri, 2014-10-24 09:21maxmether
This is a continuation of my previous blog, where we will focus on some more advanced features related to Dynamic Columns. For an introduction to Dynamic Columns please refer to my previous blog.
Dynamic Columns within WHERE
I started todays example by adding a few more items into my table, namely my two laptops to be able to produce more meaningful results. As with any function, dynamic column functions can generally be used in the WHERE clause of SELECT and other SQL statements which manipulate data. Let's execute another SELECT statement with COLUMN_GET() in the WHERE clause:
SELECT id, name AS 'White Items' FROM items WHERE COLUMN_GET(attributes, 'colour' AS CHAR) = 'white'; +----+----------------------+ | id | White Items | +----+----------------------+ | 3 | Samsung Galaxy …[Read more]