Skip to content

Query JSON inside SQL Server 2012 column

I have a column inside my SQL Server 2012 table which contains following Json data. Now I want to use this column data in my query like Is there a way to query JSON data in SQL Server 2012? Answer Honestly, this is a terrible architecture for storing the data, and can result in some serious performance issues…

MySQL #1064 Error DATETIME

I’m making a web based mail system, and I have to create a table with this code: MySQL says: #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”messages'( ‘ID’ INT(250) NOT NULL AUTO_INCRE…

How to replace empty spaces with NULL

I have a column in sql server 2012 which contain white spaces. I want to replace these empty spaces with NULL. I have written the following query but its not working. How to achieve the above functionality. Thanks in advance. Answer Use nullif

Finding max value of multiple columns in Sql

How can I find maximum value on multiple columns. This is what I have so far. This code is giving me the error: Incorrect syntax near ‘maxval’. Answer Are you simply looking for GREATEST? However GREATEST Returns NULL when a value is NULL, so you might want to care about this, too. For instance: E…