External Article

Retrieving MySQL data from within Python

The approach you take when accessing MySQL will depend on the programming language you’re using and the connector you choose for interfacing with the database. Whatever approach you take, the same basic principles generally apply to each environment. You must establish a connection to the database and then issue the commands necessary to retrieve or modify the data.

External Article

PostgreSQL 101: The 10 key differences between SQL Server & PostgreSQL

Join us for the second webinar in our PostgreSQL 101 series.

As a SQL Server developer or DBA, you have a broad skill set and have become accustomed to interacting with the larger #SQLFamily community. Now, by choice or necessity you've begun to explore PostgreSQL and things feel oddly familiar and foreign at the same time.

Join Ryan Booze on May 25th to find out the things that often trip up SQL Server users when they first start exploring PostgreSQL.

SQLServerCentral Editorial

Empathetic Design

An old sport saying goes like this “I could beat them with one arm tied behind my back.” Well, after six weeks with my arm in a sling, I am in awe of whoever tries that because everything is a lot harder. Like washing your hand and then drying it, becomes more of a challenge […]

Blogs

Free webinar – Tackling the Gaps and Islands Problem with T-SQL Window Functions

By

I’m hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM...

Counting Groups with Window Functions: #SQLNewBlogger

By

I looked at row_number() in a previous post. Now I want to build on...

Read the latest Blogs

Forums

How to determine if a DB is currently being used

By dax.latchford

Hi - I'm looking for advice regarding the best & quickest way to establish...

Data cleansing/conversion tool HPE

By juliava

Hello.   I am looking for a tool Data cleansing/conversion, was recommended HPE any...

System views in a contained availability group

By mark4data

I have a query that runs in a job to check on orphaned users....

Visit the forum

Question of the Day

The LAGging NULL

I have this data in a SQL Server 2022 table:

player         yearid team HR
Alex Rodriguez 2012   NYY  18
Alex Rodriguez 2013   NYY  7
Alex Rodriguez 2014   NYY  NULL
Alex Rodriguez 2015   NYY  12
Alex Rodriguez 2016   NYY  9
If I run this code, what are the results returned in the hrgrowth column?
SELECT
  player
, yearid
, hr
, hr - LAG (hr, 1, 0) IGNORE NULLS OVER (ORDER BY yearid) AS hrgrowth
FROM dbo.playerstats;

See possible answers