Re: insert field from another table

2004-03-24 Thread Johan Hook
Hi,

you could try something like:

INSERT INTO articles_multi(article,author,text_ru,text_en )
SELECT e.article,e.authoer,r.text,e.text
FROM articles_en e, articles_ru r
WHERE e.article = r.article
AND e.author = r.article
/Johan

nullevent wrote:

Hello mysql,

  I  have  two  tables  - articles_en and articles_ru.
  Its fields is 'article', 'author', 'text'.
  The difference is - field 'text' in articles_en has english
  text  of article and field 'text' in articles_ru has russian text of
  article. Fields 'article' and 'author' are identical.
  The tables were filled simultaneously.
  I want create table articles_multi which will have fields
  'article', 'author', 'text_ru', 'text_en' with data from articles_en
  and articles_ru. How can i do it?
- 
bye,
  nullevent 
Wednesday, March 24, 2004




--
Johan Höök, Pythagoras Engineering Group
- MailTo:[EMAIL PROTECTED]
- http://www.pythagoras.se
Pythagoras AB, Stormbyv. 2-4, SE-163 55 SPÅNGA, Sweden
Phone: +46 8 760 00 10 Fax: +46 8 761 22 77


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: insert field from another table

2004-03-24 Thread Egor Egorov
nullevent <[EMAIL PROTECTED]> wrote:
> 
>  I  have  two  tables  - articles_en and articles_ru.
>  Its fields is 'article', 'author', 'text'.
>  The difference is - field 'text' in articles_en has english
>  text  of article and field 'text' in articles_ru has russian text of
>  article. Fields 'article' and 'author' are identical.
>  The tables were filled simultaneously.
>  I want create table articles_multi which will have fields
>  'article', 'author', 'text_ru', 'text_en' with data from articles_en
>  and articles_ru. How can i do it?
> 

Create new table with CREATE .. SELECT statement, then add indexes. For example:

CREATE TABLE articles_multi
SELECT ru.article, ru.author, ru.text_ru, en.text_en
FROM articles_ru ru, articles_en en
WHERE ru.article=en.article AND
ru.author=en.author;



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



insert field from another table

2004-03-24 Thread nullevent
Hello mysql,

  I  have  two  tables  - articles_en and articles_ru.
  Its fields is 'article', 'author', 'text'.
  The difference is - field 'text' in articles_en has english
  text  of article and field 'text' in articles_ru has russian text of
  article. Fields 'article' and 'author' are identical.
  The tables were filled simultaneously.
  I want create table articles_multi which will have fields
  'article', 'author', 'text_ru', 'text_en' with data from articles_en
  and articles_ru. How can i do it?

- 
bye,
  nullevent 
Wednesday, March 24, 2004


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]