General information
Category:
Coding, syntax & commands
>>>I have a transaction table A (brand, prod_id, prod_age, in, out). My user needs a delivery pick-up list report. The pick-up requirement is usually based on brand. For example, brand A, I need 300, brand B, I need 200, etc., '300' can be 20 from prod_1, 50 from prod_2, etc. The oldest product should be pick-up first for each brand. The requirement is stored in another table B (brand, req_qty)
>>
>>let me try :
>>select a.brand, a.prod_id, b.req_qty, a.in, a.out ;
>> from a table_A, b table_B ;
>> where (a.brand = b.brand) order by 1
>>
>>hope it helps. keep experimenting with sql, it's fun. just remember
>>to read their article on sql on the knowledge base because there's
>>something about not getting the correct records but i always use
>>_tally anyway.
>
>No, it is not right. I need a result that shows
>
>Brand_A
>--------------
>Prod1_1 20
>Prod1_5 50
>Prod1_6 80
>....
>--------------------
>Subtot 300
>--------------------
>
>
>Brand_B
>--------------
>Prod2_3 46
>Prod2_9 23
>....
>------------------
>Subtot 200
>------------------
>
>The quantities are the available and older products under the brand.
Sorry. Forget about the 1 and 2 after Prod. It should be Prod_1, Prod_5, Prod_6, Prod_3, Prod_9, in case it confuse you.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only