I have table for of contracts like this
CREATE TABLE contracts
(
id INT IDENTITY(1,1) PRIMARY KEY,
contractor_id INT NOT NULL,
date DATETIME NOT NULL,
type VARCHAR(50) NULL
)
I want to know type on first contract ever made for contractor.
I have query below, but cannot get type
SELECT contractor_id, MIN(date) AS min_date
FROM contracts c
GROUP BY contractor_id
Thank you for your help