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

  • SEARCH
  • Home
  • 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 7936361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:11:27+00:00 2026-06-03T22:11:27+00:00

I have a table in the format Date | Name | Result ————————— 2012-05-02

  • 0

I have a table in the format

  Date       | Name  | Result
  ---------------------------
  2012-05-02 | bob   | W
  2012-04-01 | kevin | D
  2012-03-21 | mark  | L
  2012-03-19 | bob   | W

and would like to produce a query that i can then export to excel. at the moment the table contains some 3000 rows and a name may appear anywhere between once and 60 times and there are well 893 different unique names in the data currently.

I would like the format to be where the columns contain results ordered by the date column ascending, i.e. R1 is the oldest result for that name, R2 the second oldest. the final column (Rn) would be the most recent result. and easy way to see streaks etc.

   Name   | R1 | R2 | R3 ....
   -------------------
   Bob    | W  | W  | D | W ....
   Mark   | D  | L  |
   Trevor | 

I can do this for an individual name by selecting name, date result ordering by date ascending but this is returned as columns which of course i can manually edit in excel to columns, however is there a way to do this in sql for each name?

something like:

 select f_name,
 select f_result from table a where f_name=b.f_name order by f_date asc limit 1   as r1, 
 select f_result from table a where f_name=b.f_name order by f_date asc limit 2,1 as r2, 
 select f_result from table a where f_name=b.f_name order by f_date asc limit 3,1 as r3 
 from table b, table b
 where a.id=b.id

but obviously programtically as this would be quite time consuming to type, update and maintain.

kind regards

edit: i should note that i have rights to create tables or views etc if creating something that can then be kept up to data via a cron job would be easier.
and then my export was a select * from…

  • 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-03T22:11:28+00:00Added an answer on June 3, 2026 at 10:11 pm

    as per my question created a base table, added the columns than ran 52 line of update scripts to insert the values limited to 0,1 up to 51,1 to get the right result.

    performance was an issue on my server, so best to group these into 10/15 queries at a time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table named People in the following format: Date | Name .
I have a table in sql where the date format is stored in Hijri.
So I have a list box that displays averages in a table like format
I have a table that contains company names in this format: Name Name ,
Possible Duplicate: PHP/MySQL - Format date/time I have input field (name:day1 and varchar) to
I have user table having fields gender and first name like this.. The value
I have Following dummy table with data: ACID srno date(mm/dd/yyyy) name 3 1 04/12/2010
So i have the following query: DoCmd.RunSQL delete * from [TABLE NAME] where month
I have a query like this: Select E.ID, E.NAME, date_format( CONVERT_TZ( CONVERT_TZ( E.ST, '+00:00',
I have a table in this format. <table> <tr> <td id=divOne>div one</td> <td id=divOne>2222</td>

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.