| Stephan Szabo 2005-08-27, 8:23 pm |
| On Sun, 28 Aug 2005, Tang Tim Hei wrote:
>
>
> In the above command, I just add another table reference to it and it gives me two different results.
I'm not 100% sure what you mean, but if you mean that basically adding the
reference to test.country to a statement that looked like "select
A.* from test.currency A where A.curr_cd='USD'", yes it gives different
results, but it also means something different.
> Even I add columns like B.* to it, it do the same things too. Is it not consistance?
> In real world, I don't know the 'country' table is empty or not.
Well, you have to write your queries to do what you want depending on such
things. For example, the above doesn't constrain the join from currency
and country and so you get multiple copies of the USD currency info for
each country. If you want to constrain the currency and country
information (for example, say A.country=B.id if you had that sort of
information) you need to decide what happens if there is no country that
matches the country.
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
|