SELECT complicated

SELECT complicated

Post by David Pérez E » Wed, 06 Jun 2001 23:28:50



i have this table:
date          FK units
1999-01-01    1  10
1999-01-01    1  5
2000-01-01    2  15
2000-01-01    2  10
2000-01-02    1  5

and i want a query that shows this table like this
           FK
           ----
year month 1  2
1999   1   15  -> totalUnits per month
2000   1   25  
2000   1   5    

so far i have this

year month FK TotalUnits
1999   1   1   15  
2000   1   2   25  
2000   1   1   5    

i some body can help me with this, thanks.

David

 
 
 

SELECT complicated

Post by Zachary Well » Wed, 06 Jun 2001 23:28:16


If you post some DDL and sample data I'd be happy to help!

Zach



Quote:> i have this table:
> date          FK units
> 1999-01-01    1  10
> 1999-01-01    1  5
> 2000-01-01    2  15
> 2000-01-01    2  10
> 2000-01-02    1  5

> and i want a query that shows this table like this
>            FK
>            ----
> year month 1  2
> 1999   1   15  -> totalUnits per month
> 2000   1   25
> 2000   1   5

> so far i have this

> year month FK TotalUnits
> 1999   1   1   15
> 2000   1   2   25
> 2000   1   1   5

> i some body can help me with this, thanks.

> David


 
 
 

1. select complicated

i have this table

date       FK units
1999-01-01 1  10
1999-01-01 1  15
2000-01-01 2  5
2000-01-01 2  10
2000-01-02 1  5

i want this

            FK
year month  1   2
1999  1     25
2000  1         15 -> total units
2000  1     5

so far i have this

year  month  FK totalunits
1999    1    1   25
2000    1    2   15
2000    1    1   5

thanks for any help

David

2. Stored proc permissions question

3. Complicated Select Statement

4. SX Enterprise and Progress

5. Complicated Select!

6. mx.rpm

7. complicated select

8. Accesing through netscape

9. COMPLICATED SELECT

10. Complicated Select Statement

11. Need help with complicated* SELECT statement

12. Complicated SELECT

13. Complicated SQL Statement