- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
SELECT
IF(d.`type`='string',t_string.oin_id,
IF(d.`type`='int',t_int.oin_id,
IF(d.`type`='text',t_text.oin_id,
IF(d.`type`='enum',t_enum.oin_id,
IF(d.`type`='float',t_float.oin_id,
IF(d.`type`='set',t_set.oin_id,
0)))))) AS oin_id,
t_float.value AS value_float,
t_string.value AS value_string,
t_int.value AS value_int,
t_text.value AS value_text,
t_enum.value AS value_enum,
t_set.value AS value_set,
d.* FROM `sites__obj_info_data` d
LEFT JOIN `sites__obj_info_data_string` t_string ON t_string.`id`=IF(d.`type`='string',d.`oid_id`,0)
LEFT JOIN `sites__obj_info_data_float` t_float ON t_float.`id`=IF(d.`type`='float',d.`oid_id`,0)
LEFT JOIN `sites__obj_info_data_int` t_int ON t_int.`id`=IF(d.`type`='int',d.`oid_id`,0)
LEFT JOIN `sites__obj_info_data_text` t_text ON t_text.`id`=IF(d.`type`='text',d.`oid_id`,0)
LEFT JOIN `sites__obj_info_data_enum` t_enum ON t_enum.`id`=IF(d.`type`='enum',d.`oid_id`,0)
LEFT JOIN `sites__obj_info_data_set` t_set ON t_set.`id`=IF(d.`type`='set',d.`oid_id`,0)
WHERE d.`eid`=1
eth0 19.07.2013 19:41 # +1
Lure Of Chaos 19.07.2013 21:36 # 0