General information
Category:
Coding, syntax & commands
Title:
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
Next
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