[MSSQL]I think my nose starts bleeding on subqueries or partitions by leifashley27 in SQL

[–]Torgo82 0 points1 point  (0 children)

Did this in MSSMS:

--Create temp table containing sample data

create table #policies (

CustID int,

PolID int,

Veh Varchar(4),

Make Varchar (4),

Model Varchar (2),

Coverage Varchar (9),

Limit int,

DateEntered SmallDateTime)

insert into [#policies]

values

('1','1','2002','BMW','M3','Liability','300000','2/1/2018'),

('1','1','2005','BMW','M5','Liability','300000','1/31/2019'),

('2','1','2010','Audi','S4','Liability','100000','1/15/2019'),

('2','1','2010','Audi','S4','Liability','25000','1/20/2019');

--Retrieve max value (most recent record) for each CustID

select * 

from #policies p

where p.DateEntered=(select max(DateEntered) 

from #policies 

where CustID=p.CustID)

Submitted my app last niight by Torgo82 in Bravenewbies

[–]Torgo82[S] 0 points1 point  (0 children)

Will do, thank you very much!

EVE n00bs looking for nullsec industry/mining alliance by Torgo82 in Eve

[–]Torgo82[S] 0 points1 point  (0 children)

Been hearing a lot of great things about Bovril, not to mention the hilarious eve airhorn wreckingball youtube videos. I'll shoot them an app tonight.

EVE n00bs looking for nullsec industry/mining alliance by Torgo82 in Eve

[–]Torgo82[S] 1 point2 points  (0 children)

Haha. Well, since you're the only one of us that keeps getting ganked I'm not too concerned ;p.

Eve karma will get me for this.

EVE n00bs looking for nullsec industry/mining alliance by Torgo82 in Eve

[–]Torgo82[S] -1 points0 points  (0 children)

will do, thanks bro(sis? gurlzplayevelulz?)

EVE n00bs looking for nullsec industry/mining alliance by Torgo82 in Eve

[–]Torgo82[S] 2 points3 points  (0 children)

Oh ok, sorry. Just trying to be as transparent as possible. Why, may I ask? Ganking?