Problem You want to round up to the nearest integer. Background Suppose you have a list of final sales amount that you

Read More
How to Round Up to Nearest Integer

Problem You need use SQL to calculate the Median of a result from SQL Server. Background Suppose you need to calculate the

Read More
Use SQL to Find the MEDIAN

Problem You need to avoid SQL divide by zero errors. Suppose you need to calculate velocity using the formula v = s

Read More
How to Avoid SQL Divide by Zero

Problem Given a date, you want to subtract 30 days in the past using SQL. Said another way, get the date thirty

Read More
How to Subtract 30 Days from a Date using SQL

Problem You need to figure out the week number from date, assuming Monday is the first day of the week using PostgreSQL,

Read More
How to Find the Week Number in PostgreSQL, MySQL, and SQL Server

Problem You want to replace all occurrences of a substring with a new substring using PostgreSQL, MySQL, or SQL Server. Background The

Read More
Replace using PostgreSQL

Problem You want to use today’s date in your SQL query, but don’t want to type it in each day. Solution You

Read More
How to Get Today’s Date

How to Get a Date 30 Days into the Future. Problem You want to calculate a date 30 days into the Future

Read More
How to Get a Date 30 Days into the Future using SQL

Select Top Rows In this video we’ll walk you though how to select top rows within a query.   We’ll show you

Read More
Select the Top Row from your result.