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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:54:02+00:00 2026-06-05T02:54:02+00:00

I want to make a SELECT from a certain table (ex. table1) with a

  • 0

I want to make a SELECT from a certain table (ex. “table1”) with a column (ex. “column1”) which contains a letter followed by a number (ex. z98, k87, a245, a241, d7, e91, e32, b212, r101, r32)

Is there a way to make a select that sorts the results by this column alphabetically using the first letter and then ascending using the numbers that follow them ? (ex. a241, a245, b212, e32 etc.)
The purpose is to fill the datatables on the user interface according to their letter from the results, like this:

datatable_A= 
241 
245

datatable_B =
212

datatable_D= 
32
91

datatable_K=
87

datatable_R=
32
101

datatable_Z=
98
  • 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-05T02:54:05+00:00Added an answer on June 5, 2026 at 2:54 am

    If you mean the numbers should be treated numerically and not as string:

    create table table1 (column1 text);
    insert into table1 (column1) values
    ('z98'), ('k87'), ('a245'), ('a241'), ('d7'), ('e91'), ('e32'), ('b212'), ('r101'), ('r32')
    ;
    
    select 
        substring(column1 from 1 for 1) as datatable, 
        substring(column1 from 2)::integer as "number"
    from table1
    order by 
        datatable, 
        "number"
    ;
     datatable | number 
    -----------+--------
     a         | 241
     a         | 245
     b         | 212
     d         | 7
     e         | 32
     e         | 91
     k         | 87
     r         | 32
     r         | 101
     z         | 98
    (10 rows)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make custom select from the database table using Linq. We use
I want to make a view where I can select multiple items from listview
I want to make a script which will disable a select form element upon
I want to make this sql query in doctrine: SELECT * FROM ( (SELECT
I want to make my dropdownlist selected first value --select-- when first load page
I want to make an HTML form with 2 select boxes. The selected option
I want to make a generic function in jquery for select all functionality. I
i had soulation .i want to make navigation bar with items i will select
I want to make an application that will grab the HTML from a website
I have a xml file on which I want to make a query to

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.