Complex query (Partision and Rank) to the rescue

Hi all  
Given the table above:
I need to build a function, That when the TableID is passed to the function
It will sum the price of record with the same (ProductID, LocationID)
In this case it will sum the prices of TableID(1 and 2) The result will be 130
i.e the function will return 130. If it does not find a match. It will return null   
AKE

Will something like this be faster
WITH CTE (ProductID, LocationID, DuplicateCount)
 AS
   SELECT ProductID, LocationID,
   ROW_NUMBER() OVER(PARTITION BY ProductID, LocationID
    ORDER BY ProductID) AS DuplicateCount
    FROM MyTable
 SELECT *
 FROM CTE
 WHERE DuplicateCount > 1
 ORDER BY ProductID, LocationID, DuplicateCount
 GO
AKE

Similar Messages

  • Using lag and rank in the same query

    Hi
    I am trying to find out the difference in time between peoples memberships and also the order that these memberships are taken out in. So far I have added in a rank statement to work out the order the memberships were created in, but now want to look at the difference between the dates returned. The SQL I used is:
    SELECT owner_party_id,
    mem_number,
    support_id,
    mem_start_date,
    RANK() OVER (PARTITION BY owner_party_id ORDER BY mem_start_date ASC) MEMBERSHIP_SEQUENCE
    FROM membership_all
    WHERE version_type = 'CUR'
    AND owner_party_id IN ('65051', '65051', '65348', '65348', '65607', '65607', '65607')
    to get:
    "OWNER_PARTY_ID"|"MEM_NUMBER"|"SUPPORT_ID"|"MEM_START_DATE"|"MEMBERSHIP_SEQUENCE"
    65051|318874751|8014747|01-MAR-10|1
    65051|412311060|21502883|15-AUG-12|2
    65348|308672459|3526913|01-MAY-10|1
    65348|409951130|20950524|18-JUN-12|2
    65607|315830192|7510133|17-MAY-10|1
    65607|406448110|20024246|16-MAR-12|2
    65607|409738130|20903556|14-JUN-12|3
    Now I would like to calculate the difference between the start dates of each of the owner_party_id groups, so to get something like this:
    OWNER_PARTY_ID|MEM_NUMBER     |SUPPORT_ID|MEM_START_DATE     |MEMBERSHIP_SEQUENCE|Diff
    65051|318874751|8014747|01-Mar-10|1|     
    65051|412311060|21502883|15-Aug-12|2|898
    65348|308672459|3526913|01-May-10|1     
    65348|409951130|20950524|18-Jun-12|2|779
    65607|315830192|7510133|17-May-10|1     
    65607|406448110|20024246|16-Mar-12|2|669
    65607|409738130|20903556|14-Jun-12|3|90
    I think that I need to use the Lag function in, but I am not too sure if it can be linkited to look at the data within a grouping of owner party id, as it would make no sense to calculate the difference in dates for two different owner party ids.
    Any advice much appreciated.
    Thanks
    Edited by: 992871 on 09-Mar-2013 23:34

    Couple notes:
    1. You wrote you want to get order that these memberships are taken out in, however, both your and Etbin's queries calculate order within each owner_party_id and not across all members. If you want to get rank and difference in time regardless of member's owner_party_id remove PARTITION BY caluse.
    2. You might want to use DENSE_RANK and not RANK depending how you want to display rank. If two people joined at the same time and were second in rank, analytic RANK will be:
    RANK
    1
    2
    2
    4
    5
    .while DENSE_RANK:
    DENSE_RANK
    1
    2
    2
    3
    4
    .SY.

  • Executing the sam SQL Query again and again on the same records?

    Hi currently we have a system that will compute certain charge information base on a file finance department send to us from another system
    The problem is that their file contains of Account with bank records and account with no bank records.
    for thos account with bank records it will just send to us and we will just update it..and those account will be updated...
    but for those account that have no bank records ..it will send to us again and again..and these no bank records account will accumulate
    the finance department mention that there is not much they can do on their side except sending us the file
    is there any gd solution for this people kind to share?

    Well one simple solution which i can think of is to persist Non-bank accounts in a Serializable Object and save it in a temporary cache.
    Now before running a query on them and then trying to update the database checkout the peristed cache, check whether data records exist their or not
    if they do, dont update that records in the database.
    or define your database tables in such a way that there is an indication of abt bank & non-bak records and write a query / procedure in such a way that it do not update the duplicate non-bank records.
    Hope this might help :)
    REGARDS,
    RaHuL

  • HT4623 I am downloading OS7 and get to the rescue email. I add the rescue email hit next and I cannot move on. How can I make this happen?

    I am downloading os7 and I cannot move on after loading rescue email and clicking next. Any ideas how to move on?

    Howdy neil1422,
    It might be worth attempting a restart of the iPhone, and then a reset, should restarting fail to resolve the issue.
    iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/HT1430
    Cheers,
    Allen

  • I forgot my sec... questions and password to the rescue mail

    I forgot my security questions.. i have a rescue mail but i dont know password on it,,

    See Here.  Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    Or Email Here  >  Apple  Support  iTunes Store  Contact

  • Query LOV and how to display the LOV back in the Text item.

    Hi All,
    I have got a big time problem in getting back my LOV value after Querying it.
    Am using a Tabular Canvas having 10 rows and two columns, one having "Type"(as LOV) and corresponding "Type identifier".
    My LOV is an non data block item, having the correct return type. When ever i search for a value in the LOV, its should give out all the "Type Identifier" list and the "Type".
    But what i am facing is, am not able to get back the selected LOV after querying it and am getting the entire "Type Identifier' with out any filter.
    In short my requirement is,
    - I need to search an LOV,
    - Display the LOV value in the "TYPE" field.
    - Display the corresponding "Type Identifiers'
    Pls note: Since am new to Oracle Forms, if in your replies, if you specify to use any code in trigger, pls specify which trigger to use.
    Thanks a lot in Advance... its bit urgent
    Arun

    Hi Dave
    The requirement is suppose i have an Lov called OrgName is atatched to a column in which user will select the Ou Name from the list and internally the respective org_id will store into the database where the OU Name is available in the same data block but it is not database item . (Only org_id is database item)
    Now if you query the same block i would expect the Ou Name should display .
    Right now in my case it is not displaying anything into that column.
    Hope u understood this time..Please let me know is there any trick?

  • HT5312 i have requested the rescue email several times and have not recieved it in my email

    i am trying to acces itunes on my iphone 4 but i have forgotten my security questions and have requested the rescue email several times but have not gotten it help

    Hi ChrisMichaelson,
    Based on your description, you may need to have your iPod serviced, or at least evaluated. You may find the following page helpful:
    Service Answer Center - iPod
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipod
    Regards,
    - Brenden

  • BEx Variable defined in BI 7.0 Query Designer and using in BW 3.5 Analyzer

    Hi,
      I have defined a variable in BI 7.0 Query designer for a characteristic which is present in characteristic restrictions area to restrict it . Ideally when that query is executed a pop up box should be opened to enter a value of the variable. But when that query is opened in BW 3.5 BEx Analyzer, instead of pop up box the error message " Error specify a value for the Variable ' Variable Name '  " has been displayed. Please help me to resolve this problem
    <i><b>Details of Variable:</b></i>
    Type: Characteristic Value
    Processed by: Manual Entry/Default Value
    Variable is : Mandatory
    and Ready for input
    No default values are defined for this variable.
    Thanks
    Hari Prasad.

    Hi,
    Once a query opened and changed in the BI7.0 query designer u can not use the same query in lower version.
    Thats the reason the error message coming.
    If u need the 3.5 query just keep as it is , and copy the same query in different name and open it in the BI7.0 and do the changes.
    Thanks,
    Debasish

  • SAP Query Use and Transport Strategy

    Anyone wish to share their experience in the use of SAP Query?  We generally have an understanding that we don't want to be giving out this tool to end-users in Production.  We would like to create queries, and when we wish to give them out we'll attach t-codes to them and roll them out.
    However in practice, this is becoming difficult.  An example is where in our gold client we create queries and then we would typically transport to our unit test client.  But whenever we do an export, it generates a transport request.  Before we are done testing we may end up with 10's of transports for a single query?
    Anyone have some ideas on a transport strategy for SAP Query?  How about it's use in Production?  Our landscape for changes are typically DEV Gold -> DEV Test -> QAS -> PRD.  We would ideally like our transport strategy for queries to match what we do for everything else.

    HI,
    Query objects are transported in different ways according to the query area in which they were created.
    In order to know which transport options are available, you must first understand how query objects are created.
    <b>Standard Area</b>
    Query objects are stored in the client-specific table AQLDB. They are not connected to the Change and Transport Organizer.
    <b>Global Area</b>
    Query objects are stored in the cross-client table AQGDB. They are connected to the Change and Transport Organizer.
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb467f455611d189710000e8322d00/content.htm
    Global area objects can be transported into other systems. Standard area query objects can not only be transported to other clients within their own system, but into all clients of other systems as well. In addition, query objects can be transported from the global query area to the standard query area and back within the same system.Transports are normally performed by the system administrator, not by end-users. For this reason, you need the appropriate authorizations
    Check the below links for detailed explanation
    <b>Transporting Global Area Objects</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/ec/052786a30411d1950a0000e82de14a/content.htm
    <b>Transporting Standard Area Objects</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/ec/052789a30411d1950a0000e82de14a/content.htm
    <b>General Transport Description</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb4699455611d189710000e8322d00/content.htm
    <b>Generating Transporting Datasets</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb46a6455611d189710000e8322d00/content.htm
    <b>Reading Transport Datasets</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb46e7455611d189710000e8322d00/content.htm
    <b>Managing Transport Datasets</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/d2/cb46f4455611d189710000e8322d00/content.htm
    <b>Transporting Objects between Query Areas</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/ec/05278ca30411d1950a0000e82de14a/content.htm
    I hope this solves your purpose.
    Regards,
    Vara
    Message was edited by:
            varaprasad bhagavatula

  • Consider"Interest earned during credit period" during "Weiging and Ranking"

    Dear SRM Experts,
    In "Weighting and Ranking", for the comparison of bids,
    suppose if we have to consider the interest gained during the credit period given by the supplier, could there be any solution?
    Example:
    If the supplier1 has quoted 100600 INR with u201C15 days credit as payment terms", then effective price would be 100393.29
    If the supplier2 has quoted 100700 INR with "30 days credit as payment terms", then effective price would be 100286.16
    Calculation Details:
    Assumed Bank Interest, which purchaser's company would gain by the deiayed payment due to credit period offered by the supplier is 5%
    Supplier1     
    Quoted Price                                                 100,600.00
    Credit Period in Payment Terms               15.00
    Interest earned per day                                    13.78
    Interest earned in Credit Period                       206.71
    Effective Price Considering the Interest      100,393.29
    Supplier2
    Quoted Price                                                 100,700.00
    Credit Period in Payment Terms               30.00
    Interest earned per day                                     13.79
    Interest earned in Credit Period              413.84
    Effective Price Considering the Interest       100,286.16
    Conclusion: Supplier2 is better though he has quoted more!
    With Thanks and Regards,
    Ganapathi

    But for a commercial point of view,
    1. Calculation of Interest gained during credit period
    -  the credit period offered by the supplier and
    -  the subsequent calculation of bank interest gained during credit period,
    -  then to arrive at effective price, by deducting the gained interest...
    (If the supplier is asking Advance, we have to add the interest lost in the replenishment lead time)
    seems to be very important. Believe that is why most of the people negotiate for higher credit period with suppliers...
    2. Conversion to Local Currency
    3. Consideration of Import Freight Cost (or Local Freight, if local supplier)
    4. Calculation of Custom Clearing Charge
    5. Calculation of Local Freight charge (after custom Clearing)
    6. Calculation of Bank Charges for doing payment to suppliers
    7. Calculation of Non-Deductible portion of Duty/Taxes
    I am an MM consultant, new to SRM... The above were the calculations which we used to practice for arriving at FINAL EFFECTIVE PRICE (in Excel out side SAP), when I was in domain, while preparing Quote comparison Statement.
    Particularly, when
    (1) some suppliers are international, some are local,
    (2) The Credit period offered by various suppliers are different.
    Rest of the points seems affordable except for the first point... request comments on first point...
    Ganapathi
    Edited by: Ganapathi Hegde on Jul 7, 2010 6:27 PM

  • How to store data from a complex query and only fresh hourly or daily?

    We have a report which runs quite slow (1-2 minutes) because the query is quite complicate, so we would like to run this query daily only and store in a table so for those procedures that need to use this complex query as a subquery, can just join to this table directly to get results.
    However, I am not sure what kind of object I should use to store data for this complex query. Is data in global temp table only persist within transaction? I need something that can persist the data and be access by procedures.
    Any suggestions are welcome,
    Cheers

    Thank you for your reply. I looked at the materialized view earlier on, but have some difficulties to use it. So I have some questions here:
    1.The complex query is not a sum or aggregate functions, it just need to get data from different tables based on different conditions, in this case is it still appropriate to use meterialized view?
    2.If it is, I created one, but how to use it in my procedure? From the articles I read, it seems I can't just query from this view directly. So do I need to keep the complex query in my procedure and how the procedure will use the meterialized view instead?
    3. I also put the complex query in a normal view, then create a materialized view for this normal view (I expect the data from the complex query will be cache here), then in the procedure I just select * from my_NormalView, but it takes the same time to run even when I set the QUERY_REWRITE_ENABLED to true in the alter session. So I am not sure what else I need to do to make sure the procedure use the materialized view instead of the normal view. Can I query from the Materialized View directly?
    Below in the code I copied from one of the article to create the materialized view based on my normal view:
    CREATE MATERIALIZED VIEW HK3ControlDB.MW_RIRating
    PCTFREE 5 PCTUSED 60
    TABLESPACE "USERS"
    STORAGE (INITIAL 50K NEXT 50K)
    USING INDEX STORAGE (INITIAL 25K NEXT 25K)
    REFRESH START WITH ROUND(SYSDATE + 1) + 11/24
    NEXT NEXT_DAY(TRUNC(SYSDATE), 'MONDAY') + 15/24
    enable query rewrite
    AS SELECT * FROM HK3ControlDB.VW_RIRating;
    Cheers

  • Working with a complex query and trying to get rid of duplicates

    I'm working with the following complex query, and I need to
    select vin, number, year, make, model, and state from
    2007 vehicles in certain models, vin types
    2006 vehicles in certain models, vin types
    Is there a more efficient way to write this than how I've been writing it?:
    select distinct vehicle.vin VIN, unit.STATION_ID STID, unit.EMBEDDED_AREA_CODE||unit.EMBEDDED_PREFIX||lpad(unit.EMBEDDED_RON,4,0)
    MIN, unit.AUTHENTICATION_ID AUTHCODE, vehicle.user_veh_desc, veh_model.VEH_MODEL_DESC MODEL, veh_model.VEH_MANUF_YEAR YEAR, acct_veh.STATE STATE
    from vehicle
    inner join veh_unit on vehicle.vehicle_sak=veh_unit.vehicle_sak
    inner join unit on veh_unit.unit_sak=unit.unit_sak
    inner join vdu_profile on vdu_profile.vehicle_sak=vehicle.vehicle_sak
    inner join vdu_profile_program on vdu_profile_program.VDU_PROFILE_SAK=vdu_profile.VDU_PROFILE_SAK
    inner join veh_model on vehicle.VEH_MODEL = veh_model.VEH_MODEL
    inner join acct_veh on acct_veh.VEHICLE_SAK = vehicle.VEHICLE_SAK
    and vehicle.user_veh_desc like ('%2007%')
    AND unit.unit_gen_id >= 36
    AND vdu_profile_program.VDU_PROGRAM_SAK = 3
    and vdu_profile_program.PREFERENCE_VALUE = 'Y'
    and acct_veh.STATE in ('MN','ND','IA')
    AND (veh_model.VEH_MODEL_DESC like ('%Vehicle2%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle3%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle5%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle6%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle7%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle8%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle9%'))
    and ACCT_VEH.ACCT_VEH_STATUS_ID = 'A'
    and (vehicle.vin like ('_______3_________')
    or vehicle.vin like ('_______W_________')
    or vehicle.vin like ('_______K_________')
    or vehicle.vin like ('_______0_________'))
    UNION
    select distinct vehicle.vin VIN, unit.STATION_ID STID, unit.EMBEDDED_AREA_CODE||unit.EMBEDDED_PREFIX||lpad(unit.EMBEDDED_RON,4,0)
    MIN, unit.AUTHENTICATION_ID AUTHCODE, vehicle.user_veh_desc, veh_model.VEH_MODEL_DESC MODEL, veh_model.VEH_MANUF_YEAR YEAR, acct_veh.STATE STATE
    from vehicle
    inner join veh_unit on vehicle.vehicle_sak=veh_unit.vehicle_sak
    inner join unit on veh_unit.unit_sak=unit.unit_sak
    inner join vdu_profile on vdu_profile.vehicle_sak=vehicle.vehicle_sak
    inner join vdu_profile_program on vdu_profile_program.VDU_PROFILE_SAK=vdu_profile.VDU_PROFILE_SAK
    inner join veh_model on vehicle.VEH_MODEL = veh_model.VEH_MODEL
    inner join acct_veh on acct_veh.VEHICLE_SAK = vehicle.VEHICLE_SAK
    and vehicle.user_veh_desc like ('%2006%')
    AND unit.unit_gen_id >= 36
    AND vdu_profile_program.VDU_PROGRAM_SAK = 3
    and vdu_profile_program.PREFERENCE_VALUE = 'Y'
    and acct_veh.STATE in ('MN','ND','IA')
    AND (veh_model.VEH_MODEL_DESC like ('%Vehicle1%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle2%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle3%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle4%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle5%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle6%')
    OR veh_model.VEH_MODEL_DESC like ('%Vehicle7%'))
    and ACCT_VEH.ACCT_VEH_STATUS_ID = 'A'
    and (vehicle.vin like ('_______Z_________')
    or vehicle.vin like ('_______K_________'))

    I am not sure how many rows you have in the tables but I am assuming that there would be performance benefits in performing the query only once. You can combine similar coding and use an OR condition for the parts that are different. I left the 'K' vin comparison in both years for readability.
    I was not able to fully test my code but I believe that it will work as is. I hope it helps. If you are happier with the UNION you may want to investigate the WITH clause as you can query a subset of data twice, rather than the full data set.
    -- Common code 
    SELECT DISTINCT
       vehicle.vin,
       unit.station_id stid,
       unit.embedded_area_code || unit.embedded_prefix || LPAD (unit.embedded_ron, 4, 0) MIN,
       unit.authentication_id authcode,
       vehicle.user_veh_desc,
       veh_model.veh_model_desc model,
       veh_model.veh_manuf_year YEAR,
       acct_veh.state
    FROM vehicle
    INNER JOIN veh_unit           
       ON vehicle.vehicle_sak = veh_unit.vehicle_sak
    INNER JOIN unit               
       ON veh_unit.unit_sak = unit.unit_sak
    INNER JOIN vdu_profile        
       ON vdu_profile.vehicle_sak = vehicle.vehicle_sak
    INNER JOIN vdu_profile_program
       ON vdu_profile_program.vdu_profile_sak = vdu_profile.vdu_profile_sak
    INNER JOIN veh_model          
       ON vehicle.veh_model = veh_model.veh_model
    INNER JOIN acct_veh           
       ON acct_veh.vehicle_sak = vehicle.vehicle_sak     
    AND unit.unit_gen_id >= 36
    AND vdu_profile_program.vdu_program_sak = 3
    AND vdu_profile_program.preference_value = 'Y'
    AND acct_veh.state IN ('MN', 'ND', 'IA')
    AND acct_veh.acct_veh_status_id = 'A'
    AND
    -- Annual code
          (   -- 2006 conditions 
          AND vehicle.user_veh_desc LIKE ('%2007%')
          AND regexp_like(veh_model.veh_model_desc, 'Vehicle[2356789]')
          AND regexp_like(vehicle.vin, '_{7}[3WK0]_{9}')           
       OR
          (   -- 2007 conditions 
          AND vehicle.user_veh_desc LIKE ('%2006%')
          AND regexp_like(veh_model.veh_model_desc, 'Vehicle[1234567]')
          AND regexp_like(vehicle.vin, '_{7}[ZK]_{9}')
       ).

  • BEx query with keyfigure rank in row, chars and other keyfigures in columns

    Hi All,
        I have a BEx query with Plant and Region in rows and two keyfigures(% and rank calculation) in the column. Now my requirement is to display rank in the first column, plant and % cal. in the next columns in query output.
    Query ouput should look like :
    rank plant  %
    1     XYZ    63.00
      2    ABC   76.94 and soon.
    Is any way possible to achieve this and if yes can anyone explain in detail with steps, I apprecaite your help with points.
    Thanks
    Eric.

    Hi  Jerome,
       Thanks for quick response, is there any alternate way like customer exits or etc. This is my requirement and I need to provide the users the solution. I appreciate your valuable time.
    Regards
    Eric

  • My rescue email is a deleted email and i have no idea what the answers are to my security questions- what do I do? How do I change the rescue email?

    My rescue email is a deleted email and i have no idea what the answers are to my security questions… what do I do? How do I change the rescue email?

    You will need to contact Apple support. You can use the link in the quote below from If you forgot the answers to your Apple ID security questions - Apple Support
    If you couldn't send a reset email, don't have a rescue email address, or can't access email at your rescue email address, contact Apple Support.

  • Issues with a T61 harddisk, UNMOUNTABLE_BOOT_VOLUME, cannot also get in the Rescue and Recovery

    Dear Lenovo Support Community,
    I have a T61 with XP pro on it. This is the history of my harddisk problems with it:
    (the harddisk is HDD0 Fujitsu MHW21160BJ G1 and everything in laptop (HW and SW) are same as the factory sold one)
    1. Unfortunately I had not made any recovery cd/dvd when the computer was healthy
    2. Some time ago, after a crash, and during the chkdsk in the following boot up, harddisk showed 12kb bad sector
    3. Due to more crashes and not being able to login once, went to rescue & recovery and only recovered OS to an old and healthy state. Kept my data, lost all the new programs installed but got the OS fine and running. --> I guess the bad thing that may have happened is that recovered OS may have used those bad sectors as well, but this is just a guess.
    4. Problems, slow downs, the 12kb bad sector, issues kept coming back every couple or few weeks. Repeated the rescue and recovery OS installations another two times.
    5. Few days ago, all was good, but needed to restart, but this time a blue screen came up with UNMOUNTABLE_BOOT_VOLUME. This screen comes up even if I try to go into safe mode, with networking, or even with only DOS prompt.
    6. Tried to go to rescue and recovery (version 4), it took a really long time and was telling me that something wrong with the file \minit\setupapi.log and after a long long time that it got in the page for rescue and recovery, it was not doing anything by clicking on any of the buttons.
    7. Took the hard out, connected it through an external enclosure to another computer, the main drive could not be read at all, I/O error, not distinguishable.
    8. But the SERVICE drive was understood and I could even run chkdsk /F F:\ on it and it repaired the file mentioned above (\minit\setupapi.log).
    9. Put the hard back into T61, went to rescue & recovery, this time the error on the file was not showing up, but since the step #8, I have not been able to get pass the initial screen of rescue & recovery. It doesn't go in at all.
    10. Found it through Google search, the famous post on this forum about fixing the Master Boot Record. Got the little program, burned on a CD, went through all of its steps, finished as described in the famous thread, but I am not sure if it has been any help to me so far.
    11. In few other occasions, connected the hard through the external enclosure to another computer and found online and used programs like Disk Doctors Windows Recovery Data and EASEUS Data Recovery Wizard and was able to just read inside both NTFS main disk and FAT32 service disk (windows can also read the service disk but cannot read the main disk). Using the free version of EASEUS, I could even read and save my personal data since my last backup, so I am good to even format the T61 hard but still I don't want to give up on that.
    12. While the lenovo harddisk is in it, in a restart went to BIOS (F1) and ran the harddisk diagnosis, It said: "Pass: Controller Diag, Error code 0000: Read verification failed". And after the "Test complete", it gave a red message in the middle of screen that "<<< An error was found. Call for service >>>"
    13. As mentioned in #1, I don't have Lenovo's recovery Windows XP CD(s) for T61, but I have some other windows xp installation CD's, I thought I can put them in CD drive, boot up from CD, and try to recover or repair the windows, It seems that they tell me there is no harddisk in your computer!! When I press "R" to go to recovery console, it tells me: "Setup did not find any hard drives installed in your computer."
    My questions for dear members of this forum are:
    1. Can I recover my T61 harddisk with the above description? It is being read nicely with the recovery programs, so it should have not been damaged seriously. Please guide me to other things that I can try?
    2. I can see and read the Service part of the drive from Windows (no recovery program needed) while connecting the drive through external enclosure to another computer. Can I run a program from the Service part of disk and make those T61 Recovery CD and DVD?
    3. If I purchase the Recovery CD(s) from Lenovo, would they be doing any magic or help in my case described above?
    4. Can I make recovery CD(s) from another T61 laptop and use them for mine?
    Thanks all for reading my long post and helping me. God Bless.
    Best Regards,
    AL_K

    Step One: Install windows
    Step Two: run system update
    Step Three: Your done (optionally have a beer and relax)
    Sorry, step three was a bit of humor I added.
    Actually these recovery CDs were produced before the first T61 was made, probably in 2006. The T61 line was replaced in 2008.
    You can activate with the code on your COA, I've done it many times, just make sure you do a full (new) installation, not an upgrade, from an oem disc.
    If you do end up using the original product recovery disc set, your steps are more like this...
    1. Install disc one...   wait 30-60mins
    2. Install disc two...   wait 30-60mins
    3. Install disc three...  wait 30-60mins
    4. Install disc four...   wait 30-60mins
    5. Install disc five...  wait 30-60mins
    6. Install disc six...   wait 30-60mins
    7. Install disc seven...   wait 30-60mins
    8. Install disc eight...  wait 30-60mins
    9. download latest service pack for windows and install (over an hour)
    10. Install (replace old version)  system update and run.
    11. go to windows update and update several years worth of patches and hotfixes. (1-4 hours)
    12. kick back and have a warm beer and cold pizza, if there is any left after I finished hours ago and celibrated already.
    Also, after going through all that, you've not only installed windows, then replaced nearly the entire operating system, but you've also used valuable harddisc space to make several redundant copies of the outdated files, drivers and apps. 
    Please understand, I'm not saying the recovery discs are a bad design, they work great, and back in 2006-7-8-9 I'd happily go through all that work, but today all the stuff on them is to old so it's futile to go through all that. It would be really nice if Lenovo updated the install discs, and we could download the latest version to use, but they basically just leave them untouched after the model line is released, so nothing on that disc is newer then about 2006.
    I'll also add that both George and I have done this well over 100 times each, so we wouldn't be suggesting this if it wasn't the best option, but in the end you'll have a working system no matter which route you take to get there, so the only question to ask yourself is...
    Do you like your beer cold and your pizza hot  
    Good luck, and enjoy your endeavours
    ThinkPad W-510 i7-820QM(1.73-3.06GHz) Quad Core... ThinkPad T500, T9900, 8gb SSD...FrankNpad T-60p/61p (X9000 2.8ghz) 8gb SSD ips FlexView...ThinkPad T-61p (T9300 2.5ghz) 8gb ram...Thinkpad X-61 Tablet 4gb ram...ThinkPad A-31 (1.9ghz P4 1.5gb ram)

Maybe you are looking for