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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:04:46+00:00 2026-05-15T11:04:46+00:00

my query is showing in row 2000 the data of 2000-2001 & in 2001

  • 0

my query is showing in row 2000 the data of 2000-2001 & in 2001 the data of 2001-2002.
how can i change the column so that it displayes

column 1        column 2
2000-2001         5
2001-2002         3
2002-2003         9
2003-2004         12
.
.
.
.

and so on…

  • 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-15T11:04:46+00:00Added an answer on May 15, 2026 at 11:04 am

    Without seeing your query this will have to be very generic, but something like the following should work:

    SELECT TO_CHAR(col1) || '-' || TO_CHAR(col1+1) as "column 1",
           col2 as "column 2"
      FROM (SELECT col1,
                   SUM(col2) as col2
              FROM sometable
              WHERE something = something_else
              GROUP BY col1)
    

    The above is Oracle syntax (the TO_CHAR and || string concatenations) but should give you a good idea of how to proceed.

    EDIT: In SQL Server try the following:

    SELECT CAST(col1 AS NVARCHAR(100)) + N'-' +
                                        CAST(col1+1 AS NVARCHAR(100)) AS "column 1",
           col2 as "column 2"
      FROM (SELECT col1,
                   SUM(col2) as col2
              FROM sometable
              WHERE something = something_else
              GROUP BY col1)
    

    Share and enjoy.

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

Sidebar

Related Questions

I have a sub query that returns one column, showing as GroupType, I then
Problem is that I can not see any row in the Grid. No matter
I have a dynamic search query with join multiple tables, for showing sum and
Query: SELECT u.user_id,r.totalVotes votes,r.totalPoints rating,@row:=@row+1 rank FROM mismatch_user u LEFT JOIN ratingItems r ON
Query: UPDATE item_table SET field1=field1_spanish, field2=field2_spanish; Question: How can I update field1 with field1_spanish
I'm trying to build a query for a medical database that counts the number
I am using sqlite database for store my data.But it is showing error of
I want to query a set of tables based on the column name, type,
Newish to mysql. I have a query and it is not showing the value
I have the following query that shows the number of participants in the last

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.