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 7093101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:23:50+00:00 2026-05-28T08:23:50+00:00

I have a request of translation: (table structure: line_id lang (en or ru) text

  • 0

I have a request of translation:
(table structure:

  1. line_id
  2. lang (“en” or “ru”)
  3. text

so, in the table it looks like:

5 | en | Test
6 | en | Hello!
7 | en | Another words
6 | ru | Привет!

and all translations are in the same table with key line_id, that is independent from the language)

SELECT txt.line_id, txt.text AS o, ru.text AS t 
  FROM text AS txt, text AS ru 
 WHERE txt.line_id = ru.line_id 
   AND txt.lang = 'en';

it will return such array

> [5] => Array ( [line_id] => 5 [o] => Test [t] => Test 
> [6] => Array ( [line_id] => 6 [o] => Hello! [t] => Hello! ) 
> [7] => Array ( [line_id] => 6 [o] => Hello! [t] => Привет! )

o – is original text, t – translation.

How to delete from set #6 row, because we have translation in the next row. GROUP BY will kill #7 and save #6 row.

the best result would be:

> [5] => Array ( [line_id] => 5 [o] => Test [t] => ) 
> [6] => Array ( [line_id] => 6 [o] => Hello! [t] => Привет! )

without [o] => Hello! [t] => Hello!

  • 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-05-28T08:23:51+00:00Added an answer on May 28, 2026 at 8:23 am

    I’m just guessing you probably need:

    SELECT txt.line_id, 
             txt.text AS o, 
             COALESCE (ru.text,'UNTRANSLATED') AS t 
    FROM 
      text AS txt
    LEFT JOIN 
      text AS ru 
    ON txt.line_id=ru.line_id AND ru.lang='ru'
    WHERE txt.lang='en'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a request queue and a response queue. I would like to take
I have a request in from a client that would like one of their
I have large text files upon which all kinds of operations need to be
DB2 database. A Request can have multiple Transactions. I'd like to query the request
I have a strange problem with in-app billing RESTORE_TRANSACTION command. Every request RESTORE_TRANSACTION request
I have request where i need to change grid formatting on drop down action
I have 100 web servers and noticed that some of them have request filtering
I have linq request. I need get item.Title in select. how do this? var
I have a request controller that is getting out of hand, and I want
I have a request handler running in apache/mod_php which occasionally expands beyond the maximum

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.