Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

mysql - Is it possible to rename a joined column during an inner join?

Say I have two tables, owner and dog. Both have column name, but I'd like to join them, so there is a problem since both tables have column name. Can I rename (alias) the name column in the dog table during the query?

question from:https://stackoverflow.com/questions/5994485/is-it-possible-to-rename-a-joined-column-during-an-inner-join

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
select d.Name as DogName, o.Name
from Dog d
inner join Owner o on d.OwnerID = o.OwnerID

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...