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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:23:27+00:00 2026-05-30T13:23:27+00:00

I am looking for a possibility to run an (Oracle) SQL without querying an

  • 0

I am looking for a possibility to run an (Oracle) SQL without querying an actual table. Here I found a tip with the DUAL table. Thats pretty good. But I’m looking for a short solution to select MULTIPLE rows from “nowhere”. Is that possible? Here is the shortest query I can think of, which does what I need:

Select 1, 'foo' FROM DUAL union 
Select 2, 'bar' FROM DUAL union  
Select 3, 'more stuff' FROM DUAL

But if I want to have more rows in my result, it gets pretty unhandy. Is there a shorter way? Something like

Select 1, 'foo'; 2, 'bar'; 3, 'more stuff' from dual 
or 
Select * from (1, 'foo') union (2, 'bar') union (3, 'more stuff') 

I know, that doesn’t work, but do you have an idea? Is there an easy way to transpose a queries’ result? Something like:

Select transposed (1, 'foo', 2, 'bar', 3, 'more stuff') from dual 

I want to keep the amount “overhead-characters” at the lowest.

  • 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-30T13:23:28+00:00Added an answer on May 30, 2026 at 1:23 pm

    You can use connect by level to generate more records – something like:

    select level, decode(level, 1,'foo', 2,'bar', 3,'more stuff')
    from dual connect by level <= 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at the possibility of generating Java byte code at run time (hopefully
I am looking for a possibility to run a PHP + MySQL solution on
I am looking to run SQL queries using VBA code in an Excel file.
I was looking into the possibility of using CouchDB. I heard that it was
I'm looking for a possibility to get the color of a pixel with given
I'm currently looking for a possibility in Java to identify a font as symbolic
I've been looking at the possibility of ReHosting a WF4 Workflow to be used
I'm looking at the possibility of implementing a Levenshtein distance algorithm using APARAPI, but
We are looking into the possibility of allowing users to opt into a program
I am looking at the possibility of running a PHP-based website (built in symfony)

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.