Skip to content
Minnesota Majority

Minnesota Majority

Home Improvement Ideas & Tips

Primary Menu Minnesota Majority

Minnesota Majority

  • Home
  • HOME IMPROVEMENT
  • REAL ESTATE
  • KITCHEN
    • LANDSCAPING
  • GARDENING
    • MOVING
  • REMODELING
    • DECOR
  • CONSTRUCTION
  • DESIGN
  • PACKING
  • ROOFING
  • Contact Us
    • Write for US
  • more

sort records in postgres using just a part of string

1 year ago Alison Lurie

I have several records and one of my field is segment_number and it is as of:

PID_1
PID_2
PID_11
PID_14
PID_6

I want to sort all the records based on segment_number field but as its is a string and the number is at the end of the string I am not able to sort it in ascending order of numbers.

If I use ORDER BY segment_number,I get the order as this which is not what I want:

PID_1
PID_11
PID_14
PID_2
PID_6

What I want:

PID_1
PID_2
PID_6
PID_11
PID_14

Any leads will be appreciated.

Alison Lurie

See author's posts

Tags: natural-sort, postgresql, sql, sql-like, sql-order-by

Continue Reading

Previous The Way To Win Sales And Influence Buying Decisions Via The Inbox
Next Fixed-Football Betting Plans

More Stories

  • more

Online Bingo Halls

4 months ago Alison Lurie
  • more

Top 10 Most Exciting Book-Themed Online Slot Machines

5 months ago Alison Lurie
  • more

The Reasons Why You Should Play Online Bingo

6 months ago Alison Lurie

Recent Post

  • The Impact Of Green And Energy-Efficient Features On Home SalesThe Impact Of Green And Energy-Efficient Features On Home Sales
  • Top 4 Reasons to Make the Switch to a Silicone Toilet BrushTop 4 Reasons to Make the Switch to a Silicone Toilet Brush
  • Is A Silk Bedding Set A Good Choice? Let’s Find OutIs A Silk Bedding Set A Good Choice? Let’s Find Out

Recent Post

  • The Impact Of Green And Energy-Efficient Features On Home SalesThe Impact Of Green And Energy-Efficient Features On Home Sales
  • Top 4 Reasons to Make the Switch to a Silicone Toilet BrushTop 4 Reasons to Make the Switch to a Silicone Toilet Brush
  • Is A Silk Bedding Set A Good Choice? Let’s Find OutIs A Silk Bedding Set A Good Choice? Let’s Find Out
  • Heating and Cooling Systems are Essential to Support Quality and Comfortable LifestyleHeating and Cooling Systems are Essential to Support Quality and Comfortable Lifestyle
  • How To Be Disciplined While Cooking?How To Be Disciplined While Cooking?
  • Some Curious Facts To Know About The Boxing Day SalesSome Curious Facts To Know About The Boxing Day Sales
  • What To Look For When Buying Roller Blinds For Your OfficeWhat To Look For When Buying Roller Blinds For Your Office
  • Quality Kitchen Cabinet Rebuilt In VancouverQuality Kitchen Cabinet Rebuilt In Vancouver
  • Get The Perfect Heating Answer For Maintaining Your Private Home Heating SystemGet The Perfect Heating Answer For Maintaining Your Private Home Heating System
  • How To Get The Best Siding Experts In Downriver Michigan?How To Get The Best Siding Experts In Downriver Michigan?

You may have missed

  • REAL ESTATE

The Impact Of Green And Energy-Efficient Features On Home Sales

1 week ago Alison Lurie
  • Business

Top 4 Reasons to Make the Switch to a Silicone Toilet Brush

3 weeks ago Alison Lurie
  • bedroom

Is A Silk Bedding Set A Good Choice? Let’s Find Out

1 month ago Alison Lurie
  • HVAC

Heating and Cooling Systems are Essential to Support Quality and Comfortable Lifestyle

1 month ago Alison Lurie
  • KITCHEN

How To Be Disciplined While Cooking?

1 month ago Alison Lurie

Featured Posts

  • 5 Tips For Keeping Your Kitchen Clean5 Tips For Keeping Your Kitchen Clean
  • KitchenImprove The Aesthetics Of Your Kitchen With Blue Mid-Century Kitchen Cabinets
  • 5 Incredible Futuristic Home Designs That Look Completely Unreal5 Incredible Futuristic Home Designs That Look Completely Unreal
  • 7 Facts about Cat Tattoos That Will Make You Amazed7 Facts about Cat Tattoos That Will Make You Amazed
  • How to Choose the Right Style of TV Unit That Complements the Living Area?

Most Viewed Posts

  • The most effective method to Keep Your Sub Floor In Great Condition
  • Refashioning Your House? Don’t Settle for LessRefashioning Your House? Don’t Settle for Less
  • Shed Building PlansFacts To Grasp When Building Your 10×12 Shed Building Plans
  • To Increase Efficiency then Everyone Required Good HVAC system To Increase Efficiency then Everyone Required Good HVAC system 
  • Things Professionals Should Remember While SnowplowingThings Professionals Should Remember While Snowplowing

Trending Posts

  • 7 Facts about Cat Tattoos That Will Make You Amazed7 Facts about Cat Tattoos That Will Make You Amazed
  • The Impact Of Green And Energy-Efficient Features On Home SalesThe Impact Of Green And Energy-Efficient Features On Home Sales
  • Advantages of Investing in Real EstateAdvantages of Investing in Real Estate
  • Refashioning Your House? Don’t Settle for LessRefashioning Your House? Don’t Settle for Less
  • Ways to do a renovation of your home

Minnesota Majority

by AF themes.