is this an impossible query?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

basically my problem is that i can't work out how to get the query i require.

The system is built to store translations of comments in various languages.
The table i want to query is made up of a Language_Code, a Comment_Code, and
a Comment. The Language_Code and the Comment_Code paired making the primary
keys. For every language (language_code) in the system there is a set of
comments.

I want a query that will show the Comment_Code in the first field, then all
english comments in the second field (language_code=1), and then the
corresponding french comment in the third field (language_code = 2). This
should show all translations with the english and french side-by-side.

Any help would be greatly appreciated
 
davas100 said:
basically my problem is that i can't work out how to get the query i require.

The system is built to store translations of comments in various languages.
The table i want to query is made up of a Language_Code, a Comment_Code, and
a Comment. The Language_Code and the Comment_Code paired making the primary
keys. For every language (language_code) in the system there is a set of
comments.

I want a query that will show the Comment_Code in the first field, then all
english comments in the second field (language_code=1), and then the
corresponding french comment in the third field (language_code = 2). This
should show all translations with the english and french side-by-side.


Try something along these lines:

SELECT E.Comment_Code, E.Comment, F.Comment
FROM thetable As E INNER JOIN thetable As F
ON E.Comment_Code = F.Comment_Code
WHERE E.Language_Code = 1
AND F.Language_Code = 2
 
Works well!

Thanks!

Marshall Barton said:
Try something along these lines:

SELECT E.Comment_Code, E.Comment, F.Comment
FROM thetable As E INNER JOIN thetable As F
ON E.Comment_Code = F.Comment_Code
WHERE E.Language_Code = 1
AND F.Language_Code = 2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top