select-sql.com - SELECT SQL and upgrade your Performance

Description: Select SQL and upgrade your performance. Advanced tricks and technique for SQL. Upgrade your database skills and knowledge with Select-SQL.com.

mysql (4302) database (3564) sql (1808) db (280) mssql (155) ssis (38) t-sql (37)

Example domain paragraphs

There is an issue with Leap Year and DateAdd function that can appear if you want to compare two dates from different years and using some date value from table. For example if you have calendar table and use DateAdd function, you can get 2 rows wit two date for one source date instead of expected 1 row. See bellow reason and solution.

When you need select Min or Max value from table with one column, it's easy SQL task. A little harder is same request when you want to find minimum value and maximum value associated with column from minimal value row. For example, let's say we want see Customer with his minimum sales order plus amount value of this order and compare it to maximum value from any other order made with this customer.

Are you trying convert float to numeric and you get " Arithmetic overflow error converting float to data type numeric " error? This could happen even if all was working before and now it fails. The reason should be in precision and scales settings.

Links to select-sql.com (2)