Constantinos,

I want my product values("CHAPPIES" & "FRUIT") to be columns and not rows.

Does this make sense?

Constantinos Rocos wrote:

Adriaan,

I am not sure at all I understand what you're trying to do here...
To do exactly what you're asking, you would need to write a complex custom
query. However, I am not convinced this is what you're trying to do...

I will assume that you're trying to group by product...

If your original query looked like:
SELECT amount, product, date
FROM table

...then your new query should look like:
SELECT SUM(amount), product, MIN(date)
FROM table
GROUP BY product

However, please note:
1. 'date' is a SQL reserved word and should not be used within a query
2. The MIN() aggregate wof the 'date' could also be MAX()... It depends on
what makes more sense (if any).


HTH, -Costa

"Adriaan Putter" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

Hi,

I have this:

AMOUNT     PRODUCT     DATE
100        Chappies    2003-01-01
200        Fruit       2003-01-01
150        Fruit       2003-02-01

How can i write a query to get this:

DATE        FRUIT      CHAPPIES
2003-01-01  200        100
2003-02-01  150        0

Thanks,

Adriaan Putter
Gondwana Soft
South Africa








Reply via email to