Subject | Re: ASAP : Select,Join,Group by and Order by |
---|---|
Author | Luis Semedo Duarte |
Post date | 2009-03-12T17:43:16Z |
--- In firebird-support@yahoogroups.com, Allies Xposs <allies_xposs@...> wrote:
(below may be a correct version)
SELECT
a.p_sku,
b.M_namas,
a.p_sell,
Sum(a.P_qty) as qty,
sum(a.p_qty*a.p_sell) as total
FROM
Myss a
LEFT OUTER JOIN Pos01 b ON
a.p_sku = b.m_sku
WHERE
a.p_room = 'R301' AND
a.p_lok = '01'
GROUP BY
a.p_sku,
b.M_namas,
a.p_sell;
But apparently (without live data from your tables) the query seems fine! Do you have any records on your table that can satisfy the conditions on the query?
Cheers
Luis Semedo Duarte
>Your missing some table alias on your query!
> For All Master Of DBA...
> �
> I have Command SQL "
> �a.�� Select a.p_sku,b.M_namas,a.p_sell,Sum(a.P_qty) as qty,sum(a.p_qty*a.p_sell) as total from Myss a left Join Pos01 on a.p_sku=b.m_sku where p_room='R301' and p_lok='01' Group By a.p_sku,b.M_namas,a.p_sell
(below may be a correct version)
SELECT
a.p_sku,
b.M_namas,
a.p_sell,
Sum(a.P_qty) as qty,
sum(a.p_qty*a.p_sell) as total
FROM
Myss a
LEFT OUTER JOIN Pos01 b ON
a.p_sku = b.m_sku
WHERE
a.p_room = 'R301' AND
a.p_lok = '01'
GROUP BY
a.p_sku,
b.M_namas,
a.p_sell;
But apparently (without live data from your tables) the query seems fine! Do you have any records on your table that can satisfy the conditions on the query?
Cheers
Luis Semedo Duarte