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
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
JOINthat 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 exampleinserted select.You wrote:
I need to select all data from Bthis meansSELECT * FROM Bnot that you wrote.My advice to your is using this:
or to select specific columns
Note:
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!