Wednesday, March 14, 2012

Cassandra super column

An excellent article on Cassandra super column

http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model

From cassandra learning resources at this link.

http://programmers.stackexchange.com/questions/28992/best-cassandra-learning-resources

Monday, March 12, 2012

MySQL Group_concat (transposing rows into columns)

To find out the columns in a table in mysql where you might need it programatically. You can use the information schema.

 SELECT group_concat(column_name) as columnNames

 FROM information_schema.columns

 WHERE 

     `TABLE_NAME` = 'EMPLOYEE_TABLE'

 

This would produce the  output as a single row instead of columns.

> EMP_ID,EMP_NAME,EMP_AGE

The group_concat transposes a result set from rows into columns, which is very ideal and can save some compute logic on the application side.

http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat