Sitemap

Amicuk Programming Answers

Spliting a record into multiple rows

-0001-11-30   Views:1

Advertisement

Hi experts, need your help for your to frame a query for the below requirement Scenario 1 For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that grou

Hi experts, need your help for your to frame a query for the below requirement
Scenario 1
For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that group.
If minimum then select that record alone as shown below
Item      DC     Store     Serviceare Bgn Date     Service Area End date     Priority
9856698     1469     2952     3/5/2011     12/31/9999     100
9856698     3107     2952     12/10/2011     8/3/2012     35
Item      DC     Store     St Date     End date     Priority
9856698     3107     2952     12/10/2011     8/3/2012     35
Scenario 2
For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that group.
If not minimum split the records for that group as shown below and select the record which has the lowest priority(35) and with minimum startdate and end date range.
Item      DC     Store     Serviceare Bgn Date     Service Area End date     Priority
9856698     1469     2952     3/5/2011     12/31/9999     35
9856698     3107     2952     12/10/2011     8/3/2012      100
Item      DC     Store     St Date     End date     Priority
9856698     1469     2952     3/5/2011     12/9/2011     35
9856698     3107     2952     12/10/2011 8/3/2012     100
9856698     1469     2952     8/4/2012     12/31/9999     35

The replay answer
Advertisement
There is a seperate forum for SQL and PL/SQL.
You need to post this at :
PL/SQL
And mark this thread as answered if possible.

Go to See the other 3 answers

Spliting a record into multiple rows

Category:DefaultRelease time:-0001-11-30Views:130

Hi experts, need your help for your to frame a query for the below requirement Scenario 1 For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that grou[More]

How to Insert Record with multiple rows

Category:DefaultRelease time:-0001-11-30Views:130

Hello alls, i want to ask something... how to use insert record server behavior -  php myysql, to insert multiple rows from textfiled? thanks.It would have been more helpful if you had shown me your existing code. However, this shows the basic princi[More]

How to convert columns of record into multiple rows

Category:DefaultRelease time:-0001-11-30Views:130

Hi, I have the following data: Col1 Col2 Col3 Dat1 Dat2 Dat3 I would like to convert the above data into: Col1 Dat1 Dat2 Dat3 How can I achieve this beside using UNION? Appreciate advise urgently. Thanks and Regards, Shiau ChinSorry, I misread your r[More]

BAPI_CATIMESHEETMGR_INSERT - BAPI_CATIMESHEETMGR_INSERT - MULTIPLE ROWS

Category:DefaultRelease time:-0001-11-30Views:130

Hi to all, I'm using bapi BAPI_CATIMESHEETMGR_INSERT to insert hours in CAT2 Transaction (timesheet ) . The function seems to be working fine . The only thing that I don't understand is why it splits records on multiple rows.  For example I append re[More]

Multiple Rows into single IDoc in LSMW

Category:DefaultRelease time:-0001-11-30Views:130

Hi. I am using on_change_transfer_record for header record. have succesfully done this for header and item segment level records. but not able to done the same at IDoc control record level. My problem is, Multiple IDocs are created for single record.[More]

How to make RECORD for saving multiple rows for each employee..

Category:DefaultRelease time:-0001-11-30Views:130

Hi, How can I create a record for saving multiple rows for each employee... (parent child relationship) I have created all required fields, then created a record, and then created a page. in that page i dragged-n-dropped a scroll area on that page an[More]

Insert multiple rows into a same table from a single record

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I need to insert multiple rows into a same table from a single record. Here is what I am trying to do and I need your expertise. I am using Oracle 11g DataFile 1,"1001,2001,3001,4001" 2,"1002,2002,3002,4002" The data needs to b[More]

Convert one record row into multiple rows

Category:DefaultRelease time:-0001-11-30Views:130

Hi,    I have small requirement.I have selected one data base record into an internal table.Now internal table has 1 record i.e 1 row(ex: 10 columns). Now i will convert this single row record into multiple  records i.e 10 rows( 10 columns wil; be co[More]

Insert multiple rows of records into the database

Category:DefaultRelease time:-0001-11-30Views:130

The codes below allow me to insert a row of record into the database. How would I changed these to insert multiple rows at once? Please help! String sql = "INSERT INTO EMPLOYEES" + "(First_Name, Last_Name, Title, Phone) " + " VALU[More]

How to return to the first record of a multiple row cursor (Forms 6i)

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, I had a bit of a search through here, but couldn't quite find the answer I'm after. I have a multiple row cursor, which I feed into a multi-row block in Forms 6i. I have the following code: OPEN CURSOR; LOOP    FETCH CURSOR INTO :FIELD1, :FIE[More]

Multiple record in one row..

Category:DefaultRelease time:2015-10-11Views:130

Hi experts, I want to merge multiple row from same table into one row... is it possible? if so then how?? Regards, SKPSure, it's possible create table scott.a as select 1 a, 2 b from dual      union all select 3 a, 4 b from dual      create table sco[More]

Hot
Since I've installed Snow Leopard, I have not been able to print with my HP Laserjet 4100. My set-up: new 24" iMac, many hard drives and more. Two devices: HP Color Laserjet 5550 and HP Officejet J5750 are connected to the iMac through a USB Hub. Alt [More]
Hi, I am making a report in which i hae to display the data like this:- If there is a material and it contains batch and that batch furhter conatins sub-batches of it. The problem is dat all the data which is to be displayed is from the table CHVW  a [More]
Hello, I have one servlet which is reading the contents from web.xml and putting the values in the application object which I use in jsp program. As my servlet in get loaded at the startup so whenever I change the values in the web.xml then I need to [More]
I recently found that I could not publish a blog page using my old '06 version of iWeb and was instructed to upgrade. I just upgraded to the '09 version. It was also recommended to me that I first save my iWeb site onto a USB, which I did. I now have [More]
Hi, I've got a basic report that is causing some problems. On my selection screen there are 2 buttons ,say Button 1 and Button 2. If you click button 1 set gv_var to 'A', click button 2 and gv_var is set to 'B'.   IF sy-ucomm = 'PB_1'.     gv_ var = [More]
...been a bit since I have apped for anything......did request and got a 5k CL increase on my local CU visa a few months ago I thought...."hey, what the heck..." so I apped online for a BoA cash rewards card today.......viola.........instant app [More]
Hi Everyone Need some help from the experts here as I can't seem to work out how to get all the music on an old iPhone onto a new one. Will try and describe the problem as best I can. My husband will be getting a new iPhone 5 next week, this will be [More]
For the last week, out iPad (WiFi only) has refused to send or receive messages. When you try it says "Cannot Send Message. iMessage needs to be enabled to send this message" Similarly it has not received any messages and other devices trying to [More]
I have CS5 on a Powerbook Pro.  The computer was issued by my university, but it is mine (part of tuition).  It came with CS5 for Mac.  I would rather use it on my Windows 7 desktop.  I have only the Mac instal disk.  Is it possible somehow to switch [More]
Here's another one since I installed the updates from Mavericks. Mail has stopped letting me drag images into Finder, which means that now I have to control click, Save Attachment..., then wade through all of my folders and directories, which is a nu [More]