var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Problems with sub-query
Hi there folks, im new at PostgreSQL and i am having a noob problem creating a query, if someone can help i will be greatfull, tnks ...
I have 2 tables, just as example:
And i am trying to execute:
select A.name, Z.order_date
FROM Customer AS A ,
from ORDERS X LEFT JOIN Customer AS A ON (X.customer_id = A.customer_id)
ORDER BY X.date DESC
) AS Z
I want only one registry from my subquery ... in SQLServer i use:
order_date = (select X.order_date
from Orders X where X.customer_id = A.customer_id)
from Customer A
Someone can help me?
It's not very clear what you're trying to do. Select one order per customer? If so, a simple join should do the trick.
Last edited by futurity; 11-02-11 at 11:01.