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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:02:41+00:00 2026-05-21T04:02:41+00:00

Is there any way to select columns with wild cards. like to select columns

  • 0

Is there any way to select columns with wild cards.

like

to select columns with names having type could be ‘SELECT %type% from table_name‘ ?

  • 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-21T04:02:42+00:00Added an answer on May 21, 2026 at 4:02 am

    Not really. You can use the * column wildcard to select all columns. If you’re joining multiple tables, you can select all columns from specific table by prefixing * with the table name or alias:

    SELECT a.id, a.title, b.*
      FROM articles AS a
        JOIN blurbs AS b ON a.id = b.article
    

    However, you shouldn’t use * unless you’re writing a DB administration program.

    Alternatively, you can build a statement within SQL or another language by fetching table metadata to get the column names. Using just MySQL, you can query the COLUMNS table in the INFORMATION_SCHEMA database to get the column names and use GROUP_CONCAT to build the column list for the statement.

    SELECT CONCAT(
          'SELECT ',
          GROUP_CONCAT(COLUMN_NAME SEPARATOR ', '),
          ' FROM ', :db, '.', :table,
          ' WHERE ...'
          )
      FROM INFORMATION_SCHEMA.COLUMNS
      WHERE TABLE_SCHEMA=:db AND TABLE_NAME=:table
    

    Replace “:db”, “:table” and “…” with the appropriate values. You can even turn it into a prepared statement so you can use it for any table. From there, PREPARE and EXECUTE the constructed statement.

    If you’re not limited to SQL for programming, it should be less messy. The DB driver for your language of choice likely offers methods to get metadata. The actual implementation would be similar to the pure SQL approach (get column names, assemble statement, prepare, execute), but shouldn’t be so ugly, as you’d be using an algorithmic, rather than declarative, language.

    I would be very interested in seeing the situation that this is actually required..

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

Sidebar

Related Questions

1) Is there any way to select a random record from Freebase? If I
Is there any way I can do Select TableName.SomeColumn As SomeAlias FROM TableName In
Is there is any way to get the select Random Records using query from
Is there any way to select items in a list that aren't contained in
Is there any way to select only innermost tables? That is ones that do
I was wondering if there is any way to SELECT the first number that
is there any way in MySQL to select terms that contain OPTIONALLY (0 or
Is there any way by which we can export the result of a select
Is there any way to make the option group selectable? <select> <optgroup value=0 label=Parent
When using the select.select() method in Python, is there any way to use input

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.