Hi,
I've this SQL, I want to fetch 100 rows at a time and it should be following
100 rows when fetching the next time
Please if some one has done help me out.
Thanks
Raj
SELECT
Slstxdet.Store AS STCK_WC_Code,
Slstxdet.Sales_Trans_Date_Ora AS STCK_Load_Date,
To_Date('31-Dec-1799', 'Dd-Mon-Yyyy') + Slstxdet.Last_Act_Date AS STCK_Tx_Date,
Itemmst.Category AS STCK_Cat_Id,
Itemmst.Class AS STCK_Class_Id,
SUM(Slstxdet.Qty_Sold) AS STCK_Qty,
SUM(Slstxdet.Sales_Cost_Amount) AS STCK_Cost_Goods_Amt,
SUM(Slstxdet.Item_Sales) AS STCK_Revn_Amt
FROM Slstxdet, Strmst, Itemmst
WHERE (Slstxdet.Short_Sku <>'00082')
AND (Slstxdet.Store=Strmst.Store)
AND (Slstxdet.Short_Sku=Itemmst.Short_Sku)
AND (Slstxdet.Store = {WC_Code, char, 6})
AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date>={From_Date,
datetime})
AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date<={To_Date,
datetime})
GROUP BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
Itemmst.Category, Itemmst.Class
ORDER BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
Itemmst.Category, Itemmst.Class
Q*bert
09-05-2002, 08:50 AM
Does the table have an auto number field or a consecutive number field? If
so use it, if not, Write the data to a temp table first, populating a temp
number field and then use the values for the next 100.
Just my 2cents on it
Q*bert
@*$^@#
"Rajendra " <Rajendra.kashi@auspost.com.au> wrote:
>
>Hi,
>I've this SQL, I want to fetch 100 rows at a time and it should be following
>100 rows when fetching the next time
>
>Please if some one has done help me out.
>
>Thanks
>Raj
>
>SELECT
> Slstxdet.Store AS STCK_WC_Code,
> Slstxdet.Sales_Trans_Date_Ora AS STCK_Load_Date,
> To_Date('31-Dec-1799', 'Dd-Mon-Yyyy') + Slstxdet.Last_Act_Date AS STCK_Tx_Date,
>
> Itemmst.Category AS STCK_Cat_Id,
> Itemmst.Class AS STCK_Class_Id,
> SUM(Slstxdet.Qty_Sold) AS STCK_Qty,
> SUM(Slstxdet.Sales_Cost_Amount) AS STCK_Cost_Goods_Amt,
> SUM(Slstxdet.Item_Sales) AS STCK_Revn_Amt
>FROM Slstxdet, Strmst, Itemmst
>WHERE (Slstxdet.Short_Sku <>'00082')
>AND (Slstxdet.Store=Strmst.Store)
>AND (Slstxdet.Short_Sku=Itemmst.Short_Sku)
>AND (Slstxdet.Store = {WC_Code, char, 6})
>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date>={From_Date,
>datetime})
>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date<={To_Date,
>datetime})
>GROUP BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>Itemmst.Category, Itemmst.Class
>ORDER BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>Itemmst.Category, Itemmst.Class
Boris Milrud
09-05-2002, 04:01 PM
The following article describes how to retrieve data in sets of N rows:
http://gethelp.devx.com/techtips/oracle_pro/10min/10min0402/10min0402.asp
I believe that's exactly what you want to achieve. Let me know if you have
any questions.
Boris.
"Q*bert" <luke_davis_76@hotmail.com> wrote:
>
>Does the table have an auto number field or a consecutive number field?
If
>so use it, if not, Write the data to a temp table first, populating a temp
>number field and then use the values for the next 100.
>
>Just my 2cents on it
>Q*bert
>@*$^@#
>
>"Rajendra " <Rajendra.kashi@auspost.com.au> wrote:
>>
>>Hi,
>>I've this SQL, I want to fetch 100 rows at a time and it should be following
>>100 rows when fetching the next time
>>
>>Please if some one has done help me out.
>>
>>Thanks
>>Raj
>>
>>SELECT
>> Slstxdet.Store AS STCK_WC_Code,
>> Slstxdet.Sales_Trans_Date_Ora AS STCK_Load_Date,
>> To_Date('31-Dec-1799', 'Dd-Mon-Yyyy') + Slstxdet.Last_Act_Date AS STCK_Tx_Date,
>>
>> Itemmst.Category AS STCK_Cat_Id,
>> Itemmst.Class AS STCK_Class_Id,
>> SUM(Slstxdet.Qty_Sold) AS STCK_Qty,
>> SUM(Slstxdet.Sales_Cost_Amount) AS STCK_Cost_Goods_Amt,
>> SUM(Slstxdet.Item_Sales) AS STCK_Revn_Amt
>>FROM Slstxdet, Strmst, Itemmst
>>WHERE (Slstxdet.Short_Sku <>'00082')
>>AND (Slstxdet.Store=Strmst.Store)
>>AND (Slstxdet.Short_Sku=Itemmst.Short_Sku)
>>AND (Slstxdet.Store = {WC_Code, char, 6})
>>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date>={From_Date,
>>datetime})
>>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date<={To_Date,
>>datetime})
>>GROUP BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>>Itemmst.Category, Itemmst.Class
>>ORDER BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>>Itemmst.Category, Itemmst.Class
>
Rajendra P. KASHI
09-08-2002, 04:20 AM
Hi,
Thank you for the help. It realy worked.
Regards,
Raj
"Boris Milrud" <milrud@hotmail.com> wrote:
>
>The following article describes how to retrieve data in sets of N rows:
>http://gethelp.devx.com/techtips/oracle_pro/10min/10min0402/10min0402.asp
>
>I believe that's exactly what you want to achieve. Let me know if you have
>any questions.
>
>Boris.
>
>"Q*bert" <luke_davis_76@hotmail.com> wrote:
>>
>>Does the table have an auto number field or a consecutive number field?
> If
>>so use it, if not, Write the data to a temp table first, populating a temp
>>number field and then use the values for the next 100.
>>
>>Just my 2cents on it
>>Q*bert
>>@*$^@#
>>
>>"Rajendra " <Rajendra.kashi@auspost.com.au> wrote:
>>>
>>>Hi,
>>>I've this SQL, I want to fetch 100 rows at a time and it should be following
>>>100 rows when fetching the next time
>>>
>>>Please if some one has done help me out.
>>>
>>>Thanks
>>>Raj
>>>
>>>SELECT
>>> Slstxdet.Store AS STCK_WC_Code,
>>> Slstxdet.Sales_Trans_Date_Ora AS STCK_Load_Date,
>>> To_Date('31-Dec-1799', 'Dd-Mon-Yyyy') + Slstxdet.Last_Act_Date AS STCK_Tx_Date,
>>>
>>> Itemmst.Category AS STCK_Cat_Id,
>>> Itemmst.Class AS STCK_Class_Id,
>>> SUM(Slstxdet.Qty_Sold) AS STCK_Qty,
>>> SUM(Slstxdet.Sales_Cost_Amount) AS STCK_Cost_Goods_Amt,
>>> SUM(Slstxdet.Item_Sales) AS STCK_Revn_Amt
>>>FROM Slstxdet, Strmst, Itemmst
>>>WHERE (Slstxdet.Short_Sku <>'00082')
>>>AND (Slstxdet.Store=Strmst.Store)
>>>AND (Slstxdet.Short_Sku=Itemmst.Short_Sku)
>>>AND (Slstxdet.Store = {WC_Code, char, 6})
>>>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date>={From_Date,
>>>datetime})
>>>AND (To_Date('31-Dec-1799', 'DD-MON-YYYY') + Slstxdet.Last_Act_Date<={To_Date,
>>>datetime})
>>>GROUP BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>>>Itemmst.Category, Itemmst.Class
>>>ORDER BY Slstxdet.Store, Slstxdet.Sales_Trans_Date_Ora, Slstxdet.Last_Act_Date,
>>>Itemmst.Category, Itemmst.Class
>>
>
devx.com
Copyright Internet.com Inc. All Rights Reserved