Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 join, union, temp view? im not sure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-11 : 10:16:34
Kris writes "2 Tables, the first is default master phrases

ID LangKey Phrase
---------------
1 - Login - Log in
2 - SignUp - Sign Uo
3 - UserName - User Name
4 - Welcome - Welcome

The second is Translations

ID LangKey Phrase Culture
-------------------------------------------
1 - Login - Inizio attività - it
2 - SignUp - Firmi In su - it
3 - Welcome - Bienvenue - de

Im trying to show a list of all default translations, and if it exists the translated phrase ie. a request to view italian translations woul return

Login - Inizio attività
SignUp - Firmi In su
UserName - NULL
Welcome - NULL

Ive tried a hundred different ways and cant get it. Any help would be greatly appreciated.
Thanks

Kristian"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-06-11 : 10:27:57
For future reference, it is preferable to provide actual DDL (CREATE TABLE statements) so that someone who decides to help you can easily cut and paste and will have all the information regarding constraints etc.

I believe you can derive the desired rowset with a simple outer join on LangKey, however, I am thrown off as to why your expected output would display a NULL for the translation of ‘Welcome’?


<O>
Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-06-11 : 10:37:53
Well, Page47 (aka the mad sniper ) is right.
And here is what that outer join would look like:



SELECT mp.langkey, t.phrase
FROM
defaultmasterphrases as mp
left join (select langkey, phrase from translations where culture = 'it') as t
ON (mp.langkey = t.langkey)




Edited by - izaltsman on 06/11/2002 10:38:42
Go to Top of Page
   

- Advertisement -