MySQL Error caused by sql_mode=only_full_group_by

On December 23, 2015, in SQL, by Anuj Gakhar

If you’ve recently upgraded your MySQL server version to MySQL 5.7.5+ and you notice that some of your queries that contain GROUP BY clause, suddenly stop working, then it could be because of a change that was made in MySQL 5.7.5+. According to this page The default SQL mode in MySQL 5.7 includes these modes: […]


Railo, MySQL and Column Aliases

On January 11, 2012, in SQL, Railo, by Anuj Gakhar

Today, I encountered an error with one of my Railo powered websites (with MySQL as database) – it started throwing an error wherever column aliases were being used in the queries. On a cfdump, the column aliases were just not there in the resultset. The original column name was, though. Running the same query in […]

Tagged with:  

Executing Stored Procedures via ANT

On December 7, 2010, in SQL, ANT, by Anuj Gakhar

We are using ANT heavily in our current Project to automate builds for different environments. One of the requirements was to execute a Stored procedure from one of the ANT tasks. That sounds straightforward. Use the ANT Sql task and that should do it. But apprently, it turns out that using “EXEC” commands within a […]

Tagged with:  

Implementing Star Schema Design

On September 12, 2010, in Web Development, SQL, by Anuj Gakhar

I am working on a project that has a requirement to report some statistics historically. e.g. how many views a product had this week, this month, this year etc. how many comments were made on a product in the last quarter….and so on… although doing something like this does not sound overly complex when you […]

Tagged with:  

Conditional Logic in T-SQL

On March 21, 2010, in SQL, by Anuj Gakhar

I am sure this is a pretty common scenario in every developer’s coding journey. So I thought I would write up a little post mainly to remind me different ways of doing this as I always end up searching for it whenever I need this. Lets say you have a stored procedure that takes input […]

Tagged with:  

The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

On October 25, 2009, in SQL, by Anuj Gakhar

I was working on a client’s server, in the process of making a site live. I restored the database from a test version of the database and copied over the codebase. Everthing was exactly the same as the test site. Still, all the date related queries were throwing this error. [xml] The conversion of a […]


Getting Table Row Counts in Sql 2005

On September 6, 2009, in SQL, by Anuj Gakhar

I came across a nice tip while reading this article. If you want to get the number of rows in a table , you would normally do a select count(*) from tbl query, which does a table scan and can be a little time consuming query if the table has millions of rows. This little […]

Tagged with:  

Free eBook : Mastering SQL Server 2005 Profiler

On January 23, 2009, in SQL, Books, by Anuj Gakhar

Red-Gate software are giving away a free eBook “Mastering SQL Server 2005 Profiler”. I have just downloaded it and some of the topics could be quite useful as a developer. Especially the ones under “How Profiler can help Developers”. I just thought I would blog about it so anyone else interested can download as well.

Tagged with:  

SQL Server 2005 Common Table Expressions

On June 24, 2008, in SQL, by Anuj Gakhar

I was recently stuck with a problem where I had to loop over a self referencing table (unlimited parent child relationships from the same table) and generate a tree structure upto n levels and because my table didnt have the levels defined in it, the tree leveles were to be defined at run time. What […]

Tagged with:  


On March 3, 2008, in SQL, by Anuj Gakhar

I have always used INFORMATION_SCHEMA to some extent in some way or the other. Its quite handy to get information about database objects. This morning, I saw a nice article about this on SqlServerCentral. The author’s name is Mike and he does a pretty good job in explaining the concepts. There is also a stored […]

Tagged with:  
© 2011 Anuj Gakhar