Skip to main content
gamedev.net
🔒 Locked

Inner Join Question.

Started by wah_on_2 Dec 22, 2002 at 12:31 PM 5 replies 150+ views
Original Post
wah_on_2
wah_on_2
If i have two tables and i join two tables with inner join. What result will ouput if all columns selected and two tables contain same column name. e.g. Table1. Col1 Col2 Col3 Col4 Table2. ColA Col2 ColB ColC join table1 and table2 using inner join with the Col1 = ColA. Pls help~
Evil Bill
Evil Bill
Erm... What?
Is that SQL or something?

Member of the Unban Mindwipe Society (UMWS)
wah_on_2
wah_on_2
That mean a table can contains two same columns?
keethrus
keethrus
(edit: tone just cant be represented very well in text)

i believe that if two tables have the same column name, and they're going to be joined in some fashion, then the new columns names have the table they came from prepended to them. (is prepended a word?)

ex:

- table "pets" -
name
age
dob

- table "owners" -
name
address
phone number

- some type of join between "pets" and "owners" -
pets.name
age
dob
owners.name
address
phone number


if there is a conflict between column names, then whatever table it came from is put in front to make the column names distinct.

hope this helps,

- jeremiah

inlovewithGod.com

[edited by - keethrus on December 22, 2002 4:52:05 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.