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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:07:16+00:00 2026-06-04T12:07:16+00:00

I have two tables: A, B. I need to select all data from B.

  • 0

I have two tables: A, B. I need to select all data from B.
I could do this like

SELECT id, b1, b2, ... b20 FROM A,B WHERE A.id = B.id; 

it’s not cool solution. I will need to update this statement if I modify B’s database. Is exist something like ?

SELECT *(B) 

It selected all data from B and didn’t selected any data from A.

My databases

A
id
a1
a2
...
a20 

B
id
b1
b2
...
b20
  • 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-04T12:07:17+00:00Added an answer on June 4, 2026 at 12:07 pm

    So if you want create database seriously you shouldn’t see on complexity of way but on efficiency and speed. So my advice to you is use JOIN that is the best solution for selecting data from two and more tables, because this way is fast as possible, at least for my more cleaner like for example inserted select.

    You wrote: I need to select all data from B this means SELECT * FROM B not that you wrote.

    My advice to your is using this:

    SELECT * FROM A <INNER / LEFT / RIGHT / NATURAL> JOIN B ON A.id = B.id;
    

    or to select specific columns

    SELECT A.column1, A.column2, ... FROM A <INNER / LEFT / RIGHT / NATURAL> JOIN B ON A.id = B.id;
    

    Note:

    NATURAL JOIN will work in above example since the primary key
    and the foreign key in the two tables have the same name. So you must be very
    careful in using NATURAL JOIN queries in the absence of properly
    matched columns.

    So you really should think about how you will create database and how you will working with database, how you will pulling data for View from database, how you will insert new potential data to database etc.

    Regards man!

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

Sidebar

Related Questions

I have two different tables from which I need to pull data blogs which
I have two tables, SELECT [SHADOW_ID] ,[DATA] ,[TSN] ,[HEALTH_PLAN_CATEGORY_VALUE_ID] FROM [stbl834] and SELECT [HEALTH_PLAN_CATEGORY_VALUE_ID]
I have two tables like the ones below. I need to find what exchangeRate
1I have the following two tables (sample data) and need to be able to
I need to copy data from one table to another. The tables do not
I need a query that loops data from two tables. The two tables I
I have two tables: Holdings and Transactions Holdings data looks like: 06/30/2009, A, 100
I have two tables that I want to fetch data from. Lets call them
I have two tables : teachers (teacher_id,teacher_name) courses (teacher_id,course_id) And I need to display
I have two tables with a weak relation. I need get a text value

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.