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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:15:21+00:00 2026-05-22T14:15:21+00:00

SELECT * FROM ( SELECT city from addr_tab UNION ALL SELECT ‘zzzz’ AS city

  • 0
SELECT * FROM
(
SELECT city from addr_tab
UNION ALL
SELECT 'zzzz' AS city from dual
)ORDER BY city

I am using the above approach to retrieve the ‘zzzz’ as last record of the table. But I don’t think this would work all the time, as the city theoretically might be something bigger than “zzzz” alphabetically. Is there any other robust approach to get this harcoded record as the last record?. I need this for reporting using oracle reports. Any help would be most welcome.

  • 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-22T14:15:21+00:00Added an answer on May 22, 2026 at 2:15 pm

    Well, as others have said (in comment and answer) there is probably a better way to approach the problem from the beginning; but if you need a temporary hack read on!…

    Call the last record whatever you want…
    ‘zzzz’ is fine…
    and then use a custom ORDER BY like:

    SELECT * 
      FROM (
           SELECT city 
             FROM addr_tab
           UNION ALL
           SELECT 'zzzz' AS city 
             FROM dual
           )
    ORDER BY 
        CASE WHEN city = 'zzzz' THEN 1 ELSE 0 END,
        city;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I select all data from table/view person from database city I'll do it
I would like to use something like the following: SELECT city FROM cities WHERE
var cityList = from country in doc.Element(result) .Element(cities) .Descendants(city) select new { Name =
SELECT airline, airports.icao_code, continent, country, province, city, website FROM airlines FULL OUTER JOIN airports
Suppose I am calling a query SELECT name, city, country FROM People. Once I
Can this be done w/ linqtosql? SELECT City, SUM(DATEDIFF(minute,StartDate,Completed)) AS Downtime FROM Incidents GROUP
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY hrl.Frn) as Row, hrl.unq, hrl.LcnsId, hc.Business,hc.Name,hc.Phone,
How to translate select *from ( select EmployeeID,FirstName,LastName,Region from Employees where city in ('London','Seattle')
SELECT T1.name AS hotel, T2.name AS city FROM (SELECT * FROM hotel WHERE name
SELECT ID, Name, (SELECT CityName FROM City WHERE Employee.CityID = City.CityID) AS [City Name]

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.