0

I have a table that contains the below data enter image description here

I want to write a query that display the below data enter image description here

1
  • What have you tried? Please add to your question your code so far, even if it is broken. Is there a particular part that is confusing you? Commented Dec 10, 2011 at 17:10

1 Answer 1

3

Use a self join:

SELECT eng.id, eng.description english,
  fre.description 
FROM label eng JOIN label fre ON eng.id = fre.id
WHERE eng.languageId = 1 and fre.languageId= 2

As you didn't give a table name I choose label replace it with your real table name.

Sign up to request clarification or add additional context in comments.

1 Comment

I would prefer to use proper ANSI JOINs : FROM label eng INNER JOIN label fre ON eng.id = fre.id WHERE eng.languageId = 1 and fre.languageId = 2 - these are both cleaner, and that's the ANSI standard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.