Reputation: 103
I saw a Oracle statement, like this:
SELECT sn.launch_cd, sb.launch_cd FROM standard_nuke sn, standard_ballistic sb WHERE country = 'US';
The "standard_nuke sn, standard_ballstic sb" part appears to take the form of
[table_name] [name]
What is this called?
Upvotes: 2
Views: 44
Reputation: 106430
That is called a table alias. It's not specific to Oracle; most databases support this, or a notion of it.
Aliases offer a more convenient way to refer to a table, or allow you to specify which table's column you're referring to.
For instance, if standard_nuke
and standard_ballistic
both had a column country
, you could specifiy that you meant your WHERE
clause to concern itself with standard_nuke
's country by this SQL:
SELECT sn.launch_cd, sb.launch_cd
FROM standard_nuke sn, standard_ballistic sb
WHERE sn.country = 'US';
Upvotes: 3