sql - Define Column Aliases? -
I have such a query:
SELECT * * 'FROM (` Threads` t, `members`m) where` m``````````` and `t` Type Type = '0' and `t``` Category = '1'
And what happens basically that both tables (members and threads) have an ID field, It is happening that the result is getting messed up ie IE: there is only one ID field which is getting populated from the members table.
What I need to do is create results with the prefix of their nickname so that I can differentiate between two: IE: Add 'T'. All thread fields and 'm' in all members' areas
Then the result should be the same: m.id = x, t.id = y Instead, the results of this time are the same: id = x (thread field is the ID field from the table of members completely (Overwritten from)
Usage:
Select MID AS X TIi = M from TID 'Y' members on MT Author and t Column names are defined on a column on a column - you can not use wildcards / etc. Type = '0' and TC Category = '1'
You can use the keyword as
or just add columns upper within the single quote if column names do not include special characters - if it does Use double quotes so you can add single / double quote usage with the keyword as
.
Do I have a list of all the columns?
Yes, you have until you do not like duplicate columns, because you m *
or T. *
, then to list all the columns. There is no conference in SQL that you ask. SELECT *
.
Appendix
I took the liberty to rewrite your query to use ANSI-92 join syntax - your example ANSI-89 There is no performance difference.
Comments
Post a Comment