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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:55:34+00:00 2026-06-05T09:55:34+00:00

I figure there has to be a specific design reason why you can’t write

  • 0

I figure there has to be a specific design reason why you can’t write a query like the following one:

select 
    (select column_name 
    from information_schema 
    where column_name not like '%rate%' 
    and table_name = 'Fixed_Income')
from Fixed_Income

and instead have to resort to dynamic SQL.

Anyone knows what that reason is? I tried Googling it, but all the hits were cries for help in solving the problem — meaning it’s a pretty widespread need and not well understood.

  • 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-05T09:55:35+00:00Added an answer on June 5, 2026 at 9:55 am

    You ask a very interesting question.

    The “relational” in “relational algebra” refers to name-value pairs, not to relationships between tables. In relational algebra, there is no requirement that all records in a set (table) have the same columns.

    My best guess is that the limitation is related to the idea of entity-relationship diagrams comes into play. A database is designed around tables, and these tables have relationships to each other. The choice of a relational database for data storage and access was specifically when the data could be stored this way. Knowing the entities and their attributes suggests a static form of the data and hence static references in queries.

    In addition, SQL as a language is a declarative language rather than a procedural language. This suggests — but does not impose — a compilation step separate from the running of the query. In general, the SQL engine does the following (at a very high level):

    1. Compiles the query, generally into some sort of data flow process.
    2. Optimizes the data flow process. (Typically part of the compilation process.)
    3. Runs the query.

    The first two result in what is called “the query plan”. You really cannot do optimization, though, unless you know about the objects you are operating on. So, dynamically choosing tables and columns means that optimization would be part of running the query rather than compiling it.

    Finally, some databases like SQL Server support dynamic SQL. This allows you to build strings that get compiled and run at the same time. This is very useful for complex decision support queries. It is not recommended when you need fast transaction throughput, because the overhead for compilation is too high relative to the query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Somehow I can't figure out how to implement the following relations using Doctrine 2
I can't seem to figure out the proper regular expression for extracting just specific
Is there a query that will get me foreign keys directed at a specific
I'm trying to figure out if there's anything in QT that is equivalent to
I'm trying to figure out if there is a way (using JavaScript, or jQuery
I'm trying to figure out if there is an easy way to do the
I'm trying to figure out if there is a css property (or any other
I'm trying to figure out if there is a property in Android contacts that
This is a bit unorthodox but I'm trying to figure out if there's a
I am experimenting with Tkinter, as I was trying to figure out is there

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.