Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Max & Min Amount through SQL
Hi,
i have a parent child table for invoice.
Parent Table -Invoice
: Invoice_Id, Invoice_Amount, Invoice_item, Invoice_Date.
Child Table - Invoice_Detail
: Item_#, Product_Id, Quantity, Unit_Price, Invoice_Id.
i need to know the following through sql,
hope you can help me, thanks ...
case 1: Max & Min Amount of Purchase of a day.
--------------------------------------------------------------------------
Required output : Type of Invoice Invoice_Number Invoice_Amont
--------------- -------------- -------------
Maximum Invoice 9999999999 $99,999.99
Minumum Invoice 9999999999 $99,999.99
case 2: 1, 2, 3 item & above invoice of a day.
--------------------------------------------------------------------------
require output : Type of Invoice Number_Of_Invoice Total_Amount
--------------- ----------------- -------------
1_Item_Invoice 999 $9,999,999.99
2_Item_Invoice 999 $9,999,999.99
3_Item_Above 999 $9,999,999.99
case 3: Total & Average of Invoice in a day
--------------------------------------------------------------------------
require output : Type of Invoice Number_Of_Invoice Total_Amount
--------------- ----------------- -------------
Total_Invoice 999 $9,999,999.99
Average_Invoice 999 $9,999,999.99
Thanks In Advance
Willie Chen
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement