MySQL Forums
Forum List  »  French

Re: Etrange jointure?
Posted by: Michael Seguin
Date: April 01, 2009 02:54AM

Bonjour,
Merci pour cette réponse. Je ne réponds que tardivement, n'ayant pas reçu le mail de *follow*.


mysql> alter table temp_donnees change date date_reference date;
Query OK, 2496 rows affected (0.15 sec)
Records: 2496 Duplicates: 0 Warnings: 0

mysql> describe temp_donnees;
+----------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------------------+------+-----+---------+-------+
| id_serie | bigint(20) unsigned | YES | MUL | NULL | |
| date_reference | date | YES | MUL | NULL | |
| valeur | double | YES | | NULL | |
+----------------+---------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> select a.date_reference, a.valeur, b.valeur from temp_donnees a left join temp_donnees b on a.date_reference=b.date_reference where a.id_serie=5 and b.id_serie=22 order by a.date_reference;
+----------------+--------+--------+
| date_reference | valeur | valeur |
+----------------+--------+--------+
| 2008-11-06 | 1025 | 640 |
| 2008-11-13 | 970 | 595 |
[...]
| 2009-03-12 | 725 | 500 |
| 2009-03-19 | 690 | 500 |
+----------------+--------+--------+
20 rows in set (0.01 sec)


J'avoue posséder des conventions de nommage très personnelles et ne pas toujours adhérer au préfixage/suffixage des tables/champs :) Cela dit, il est vrai que cela peut poser problème de nommer un champ avec un mot-clé, mais cela ne change pas le résultat dans notre cas, malheureusement.

Options: ReplyQuote


Subject
Views
Written By
Posted
6830
March 31, 2009 11:01AM
3916
March 31, 2009 11:17AM
Re: Etrange jointure?
3533
April 01, 2009 02:54AM
3738
April 02, 2009 10:19AM
3289
April 02, 2009 11:12AM
3335
April 02, 2009 11:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.