グループごとに1つの行を返したい場合は、複数の並べ替え列で選択します。重複した質問を避けるために、greatest-n-per-groupの土地でここを軽く踏む。 SCHEMA: CREATE TABLE logs (
id INT NOT NULL,
ip_address INT NOT NULL,
status INT NOT NULL,
PRIMARY
で最新の日付の取得: WITH Result AS (
select distinct
--pump.Product_PN,
--pump.product_name,
mot.Motor_pn,
Mot.Motor_name,
mas.STLAN AS Usage,
po.DATUV as change_date,
mot.[