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 6745743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:14:27+00:00 2026-05-26T12:14:27+00:00

Query I’m using: SELECT COUNT(*), SUM(amount) AS amount, FROM_UNIXTIME(added, ‘%W (%e/%m)’) AS daily FROM

  • 0

Query I’m using:

SELECT COUNT(*),
    SUM(amount) AS amount,
    FROM_UNIXTIME(added, '%W (%e/%m)') AS daily
FROM affiliates_earnings
WHERE added >= '1319074836'
    AND added <= '1319679636'
GROUP BY daily

Output:

+----------+--------+-------------------+
| COUNT(*) | amount | daily             |
+----------+--------+-------------------+
|        1 |    195 | Tuesday (25/10)   |
|        4 |    470 | Wednesday (26/10) |
+----------+--------+-------------------+

What I would like to show up:

+-------+----------+--------+-------------------+
| i     |COUNT(*)  | amount | daily             |
+-------+----------+--------+-------------------+
| 1     |        1 |    195 | Tuesday (25/10)   |
| 2     |        4 |    470 | Wednesday (26/10) |
+-------+----------+--------+-------------------+

Essentially i would be the sequential number (i.e. 1,2,3,4,5,6…).

How would I accomplish this?

  • 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-05-26T12:14:28+00:00Added an answer on May 26, 2026 at 12:14 pm

    Without ROW_NUMBER(), you can fake it per this answer or this one:

      SELECT @i := @i + 1 AS i, COUNT(*), ...
        FROM affiliates_earnings
        JOIN (SELECT @i := 0) dummy
       WHERE ...
    GROUP BY ...;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Query 1: select PremiumYTDCurrent=Sum((AASI.Inv_Premium)*R.[Percent]), R.STAFF, L.Description, L.LINE_OF_BUSINESS from AAS_Invoice AASI,Invoice I,Revenue_Tracking R, Policy P,
The query is: select sum(value) from TAB where TimeStamp= { select max(TimeStamp) from TAB
Query: SELECT SUM(ProductCost) FROM `tblBasket` GROUP BY ProductCode HAVING BasketSessionID = '3429782d79c68834ea698bb4116eef5e' Showing Error
Query: SELECT DISTINCT ([Equipment List].ID) AS Expr1, [Job Assignments].Job FROM [Equipment List] LEFT JOIN
Query: Select * from pu_Products where Part_Number in ('031832','027861', '028020', '033378') and User_Id =
Query: SELECT A.USER_ID, A.ROLE_ID, C.SUBGROUP, MAX(A.STATUS_ID) FROM USER_ROLE A, USER B, ROLE C WHERE
Query: select `r`.`id` as `id` from `tbl_rls` as `r` left join `tblc_comment_manager` as `cm`
Query: SELECT StartDate, EndDate, RIGHT(Sector, 1 ) FROM Table1 ORDER BY Right(Sector, 1), StartDate
Query: SELECT * FROM Post ORDER BY Post.rating <-- Here , i want (
Query 1: SELECT ARRAY(select id from contacts where id = 0)::INT[], ARRAY[]::INT[], ARRAY(SELECT id

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.