Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8997751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:55:53+00:00 2026-06-15T23:55:53+00:00

There is no result and no error when I try the following locally: select

  • 0

There is no result and no error when I try the following locally:

 select
  a,
  bunch,
  of,
  fields
    from import where id in (
        SELECT distinct t1.id
        FROM import t1 inner join import t2 
        on t1.programid = t2.programid and t1.sku = t2.sku 
        where t1.lastupdated < t2.lastupdated   
    )

This query is part of a query to copy old records to archive this is the part fetchng the data that needs to be moved.

When I run the whole thing in cpanel’s phpmydmin nothing happens, no error and no records are copied, when I run the statament that only gets the data nothing is returned, the page just sticks in loading and that’s it.

There are over a million records and 2/3 needs to be archived, I have to use cpanel that has phpmyadmin but think it’s unfit to run queries like that. When combined with “insert into” the above statement locks up the phpmyadmin session for 2 hours but no records are copied.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:55:54+00:00Added an answer on June 15, 2026 at 11:55 pm

    I have have phpmyadmin do this on queries wit subselects on some versions of it.

    However try this SQL, which should do the same but might be more efficient.

    SELECT a, bunch, of, fields
        FROM import 
        INNER JOIN (SELECT distinct t1.id
            FROM import t1 inner join import t2 
            on t1.programid = t2.programid and t1.sku = t2.sku 
            where t1.lastupdated < t2.lastupdated ) Sub1
        ON import.id = Sub1.id
    

    Edited to add the below code to retrieve records which do not have the latest lastupdated for each programid / sku

    SELECT a, bunch, of, fields
    FROM import 
    LEFT OUTER JOIN (SELECT programid, sku, MAX(lastupdated) AS lastupdated FROM import GROUP BY programid, sku) Sub1
    ON import.programid = Sub1.programid AND import.sku = Sub1.sku AND import.lastupdated = Sub1.lastupdated
    WHERE Sub1.programid IS NULL
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to add the select-result on the url when the pop
Is there any way of accessing both a result set and output parameters from
Is there a way to directly write result returned from TSQL / stored procedure
Is there any way by which we can export the result of a select
Wondering if there is any way to get the lambda expressions that result from
From my understanding the following should properly throw a custom error from a WCF
I'd like to achieve this result there are many tutorial around like this but
Is there a 'Max # of result sets that can be displayed' when executing
There is a similar question How can I assign the result of a subroutine
Where there are so many ways to achieve the same result, I am wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.