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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:04:09+00:00 2026-06-13T02:04:09+00:00

My (simplified) query SELECT name, city FROM some.tbl WHERE name LIKE %clarendon% ORDER BY

  • 0

My (simplified) query

SELECT name, city FROM some.tbl WHERE name LIKE "%clarendon%" ORDER BY city, name

I get something like below:

name                            city
Budget Lodge Clarendon          Clarendon
Clarendon Artillery Lane        London
Clarendon Barbican Studios      London
Clarendon Brushfield St         London
Clarendon Canary Central        London
Clarendon Commercial St         London
Clarendon Cottages              Sassafras
Clarendon Discovery Dock East   London
Clarendon Gooch House           London
Clarendon House And Gardens     Kew
Clarendon Luxury Apartments     Edinburgh
Clarendon Manning Place         Richmond
Clarendon Minories              London
Clarendon Motel                 North Conway
Clarendon Pepys St              London
Clarendon Puma Court            London
Clarendon Steward St            London
Clarendon Vine St               London
Clarendon Wellington St         London
Clarendon Wraysbury             Staines
Hotel Clarendon                 Quebec
The Clarendon                   London
The Clarendon Bantry Bay        Cape Town
The Clarendon Fresnaye          Cape Town
The Clarendon Hotel             Newcastle

What I would like to get is this –

col.name keeps its order, but col.city gets ordered by col.name fragment enging with word clarendon:

name    city
  Budget Lodge Clarendon          Clarendon
  Clarendon Luxury Apartments     Edinburgh
  Clarendon House And Gardens     Kew
  Clarendon Artillery Lane        London
  Clarendon Barbican Studios      London
  Clarendon Brushfield St         London
  Clarendon Canary Central        London
  Clarendon Commercial St         London
  Clarendon Discovery Dock East   London
  Clarendon Gooch House           London
  Clarendon Minories              London
  Clarendon Pepys St              London
  Clarendon Puma Court            London
  Clarendon Steward St            London
  Clarendon Vine St               London
  Clarendon Wellington St         London
  Clarendon Motel                 North Conway
  Clarendon Manning Place         Richmond
  Clarendon Cottages              Sassafras
  Clarendon Wraysbury             Staines
  Hotel Clarendon                 Quebec
  The Clarendon Bantry Bay        Cape Town
  The Clarendon Fresnaye          Cape Town
  The Clarendon                   London
  The Clarendon Hotel             Newcastle

EDIT
Typo – of course it is “ORDER BY name, city ”
but question still remains valis

  • 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-13T02:04:11+00:00Added an answer on June 13, 2026 at 2:04 am

    The question is incorrect. The query you posted would already give you the second results.

    [edit]

    ORDER BY
      substr(name, 1, 9), city, name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I am doing something like this: select a.name from schedule as a where
I have a query like this: SELECT Name, REPLACE(RTRIM(( SELECT CAST(Score AS VARCHAR(MAX)) +
I have a query SELECT d.name, count(e.id) FROM department d LEFT OUTER JOIN employee
I have a fairly simple Linq query (simplified code): dim x = From Product
I have below a working query that needs to be simplified. The reason is
How can I optimize below SQL (simplified view of my complex query.) Ideally, I
I need some help putting together this query in Django. I've simplified the example
I have a query that I have simplified and written below. How do I
I currently have this query set-up: SELECT topic.content_id, topic.title, image.location FROM mps_contents AS topic
I currently have this query set-up: SELECT topic.content_id, topic.title, image.location FROM mps_contents AS topic

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.