Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:36:49+00:00 2026-06-07T07:36:49+00:00

I have a table with 3 columns: label_value, language_value, language . It’s table for

  • 0

I have a table with 3 columns: label_value, language_value, language. It’s table for labels, where label_value = "name" of the label, language_value – translation of the label, language – id of language which is using. So, I need to extract label_value, language_value for English (language=45) and language_value for my language(language=24). Please, note, that not all English labels has translation to my language, but I need to extract all English labels and if the label has no translation to my English then it must return this label with NULL language_value for my language. So, I have made the following code:

SELECT e.label_value, e.language_value
FROM labels e, labels t
WHERE e.label_value=t.label_value AND e.language=45 AND t.language=24  

I understand that it’s not full and right query, because it hasn’t returned not all English labels and returned some labels 2 times. Please, edit it. Thank you.

UPDATED:

Also I need that queries for locale satisfy the condition: t.approved=’1′ or t.user_id=123.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:36:51+00:00Added an answer on June 7, 2026 at 7:36 am

    You can use a left join to look up the optional local-language row:

    select  eng.label_value
    ,       coalesce(loc.language_value, eng.language_value)
    from    labels eng
    left join    
            labels loc
    on      loc.language = 24
            and eng.label_value = loc.label_value
            and (loc.approved = '1' or loc.user_id = 123)
    where   eng.language = 45             
            and (eng.approved = '1' or eng.user_id = 123)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with columns 'id', 'name', 'value', 'uniqueConst' in both databases. Now
I have a table whose columns are varchar(50) and a float . I need
BACKGROUND: I would like to have small labels in columns of a table. I'm
I have a table in SQL Server which looks like this: ID Code Name
I'm using play-1.2.3. I have two classes some kind of these: LabelItem: @Entity @Table(name=T_LABEL_ITEM)
I have a table name AVUKAT and it's columns ( AVUKAT , HESAP (Primary
I have a table. The first column contains labels. The rest of the columns
We have a table with two columns: in each row there is a label
The table columns have the data type BLOB and CLOB. What are the corresponding
I have table with two columns (varchar from, varchar to). This table represents connections

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.