<p>I frequently run into problems of this form and haven't found a good solution yet:</p>

<p>Assume we have two database tables representing an e-commerce system.</p>

<pre><code>userData (userId, name, ...)
orderData (orderId, userId, orderType, createDate, ...)
</code></pre>

<p>For all users in the system, select their user information, their most recent order information with type = '1', and their most recent order information with type = '2'. I want to do this in one query.  Here is an example result:</p>

<pre><code>(userId, name, ..., orderId1, orderType1, createDate1, ..., orderId2, orderType2, createDate2, ...)
(101, 'Bob', ..., 472, '1', '4/25/2008', ..., 382, '2', '3/2/2008', ...)
</code></pre>

Their newest you mean all new in the current day? You can always check with your createDate and get all user and order data if the createDate >= current day.
```
```
SELECT * FROM
"orderData", "userData"
WHERE
"userData"."userId"  ="orderData"."userId"
AND "orderData".createDate >= current_date;
```
```
UPDATED
Here is what you want after your comment here:
```
```
SELECT * FROM
"orderData", "userData"
WHERE
"userData"."userId"  ="orderData"."userId"
AND "orderData".type = '1'
AND "orderData"."orderId" = (
SELECT "orderId" FROM "orderData"
WHERE 
"orderType" = '1'
ORDER "orderId" DESC
LIMIT 1
```
```
)