Hello friends,
I need to write a query to compare the quotations recived from various vendors item wise.
Which means that different vendors may give different prices for the same item... i want to find out the least price for each item and assign a rank to it....
I have gone through oracle's rank function but was unable to find out a solution... here is my table structure and data
SQL> desc KAS_VW_TMP_QTN_COMPARE;
Name Null? Type
--------------------- -------- ----------------------------
RFQ_HDR_ID NUMBER(10)
RFQ_NO NOT NULL VARCHAR2(50)
VEND_NAME NOT NULL VARCHAR2(500)
QTN_DATE NOT NULL DATE
RFQ_MAP_ID NUMBER(10)
TOT_AMT NUMBER
VEND_QTN_REF NOT NULL VARCHAR2(100)
QTN_HDR_ID NUMBER(10)
ITEM_GRP_ID NUMBER(10)
ITEM_ID NUMBER(10)
RFQ_QTY NOT NULL NUMBER(20,3)
QTN_QTY NUMBER(10)
PRICE_PER_UNIT NUMBER(20,3)
ITEM_WISE_AMT NUMBER(20,3)
Data is:
========
RFQ_NO VENDOR ITEM ITEM WISE AMT
================= ================== ==== ==============
RFQ/03-2006/00002 BIN KHAMAS TRADING 1 69
RFQ/03-2006/00002 BIN KHAMAS TRADING 4 8
RFQ/03-2006/00004 BIN KHAMAS TRADING 3 160
RFQ/03-2006/00004 BIN KHAMAS TRADING 1 165
RFQ/03-2006/00004 SHEYA TRADING 1 198
RFQ/03-2006/00004 SHEYA TRADING 3 3080
RFQ/03-2006/00002 SHEYA TRADING 1 15
RFQ/03-2006/00002 SHEYA TRADING 4 1210
HOPE ITS CLEAR ENOUGH
waiting ur helpful responses
thanks in advance
gazal
I need to write a query to compare the quotations recived from various vendors item wise.
Which means that different vendors may give different prices for the same item... i want to find out the least price for each item and assign a rank to it....
I have gone through oracle's rank function but was unable to find out a solution... here is my table structure and data
SQL> desc KAS_VW_TMP_QTN_COMPARE;
Name Null? Type
--------------------- -------- ----------------------------
RFQ_HDR_ID NUMBER(10)
RFQ_NO NOT NULL VARCHAR2(50)
VEND_NAME NOT NULL VARCHAR2(500)
QTN_DATE NOT NULL DATE
RFQ_MAP_ID NUMBER(10)
TOT_AMT NUMBER
VEND_QTN_REF NOT NULL VARCHAR2(100)
QTN_HDR_ID NUMBER(10)
ITEM_GRP_ID NUMBER(10)
ITEM_ID NUMBER(10)
RFQ_QTY NOT NULL NUMBER(20,3)
QTN_QTY NUMBER(10)
PRICE_PER_UNIT NUMBER(20,3)
ITEM_WISE_AMT NUMBER(20,3)
Data is:
========
RFQ_NO VENDOR ITEM ITEM WISE AMT
================= ================== ==== ==============
RFQ/03-2006/00002 BIN KHAMAS TRADING 1 69
RFQ/03-2006/00002 BIN KHAMAS TRADING 4 8
RFQ/03-2006/00004 BIN KHAMAS TRADING 3 160
RFQ/03-2006/00004 BIN KHAMAS TRADING 1 165
RFQ/03-2006/00004 SHEYA TRADING 1 198
RFQ/03-2006/00004 SHEYA TRADING 3 3080
RFQ/03-2006/00002 SHEYA TRADING 1 15
RFQ/03-2006/00002 SHEYA TRADING 4 1210
HOPE ITS CLEAR ENOUGH
waiting ur helpful responses
thanks in advance
gazal