0

私は2つのテーブルを持っています

--------------------------------------------
TABLE 1:
ID
DUREE_FREQ_ID => foreign key idFrequence
POSOL_FREQ_ID => foreign key idFrequence
INTER
------------------------------------------
TABLE 2:
idFrequence
libFrequence
-------------------------------------------

とを同時に取得libFrequenceするクエリを作成したい!DUREE_FREQ_IDPOSOL_FREQ_ID

4

2 に答える 2

0
SELECT
  t1.id,
  t1.duree_freq_id,
  td.libfrequence AS duree_freq,
  t1.posol_freq_id,
  tp.libfrequence AS posol_freq
FROM table1 t1
LEFT JOIN table2 td ON (td.idfrequence = t1.duree_freq_id)
LEFT JOIN table2 tp ON (tp.idfrequence = t1.posol_freq_id);
于 2013-11-07T15:24:36.130 に答える