I'm fairly rusty at SQL as its been a long time since I've used it and I've rarely needed to do complex queries even when I have.

I have a database with data columns as follows:

```
Key, Instance, User ID, Day, Size

```

**Key** - This is the primary key.  

**Instance** - This is a descriptor of the specific instance (this will be unique).  

**User ID** - This will refer to 1 of a number of users where the number will be less than the number of entries in this table.  

**Day** - This is the day the specific user created this instance. It will be one of either Day 1 or Day 2.  

**Size**- This is the size of the data stored.  

Now not all users will have created instances on 2 days (though they may have created multiple instances on either day).

I'm after a query that will Select the Instance with the largest size on Day 1 where that user ID also created an Instance on Day 2.

I'm completely lost as to where to start on this one.

I wrote some C# code that filtered the results returned from a far simpler SQL query, however it is way too slow to give me the kind of results I would like.

Am I hoping for too much from SQL (ie is what I ask even possible)? IF so can anyone give me an example of such a query with an explanation of what each step of the, presumably, compound query is doing?

Thanks!