Exercise: 43

Get the battles that occurred in years when no ships were launched into water.

Solution

SELECT name
FROM battles
WHERE DATEPART(yyyy, date) NOT IN (
	SELECT launched
	FROM ships
	WHERE launched IS NOT NULL
)


References

  1. DATEPART (Transact-SQL)