Hi, 

I need to joint two table 

This table show change set up limts value.

+------------+-----------+-----------+
|   edittime | lim_lower | lim_upper |  
+------------+-----------+-----------+
| 01.01.2011 | 0.8       | 12.1      |
+------------+-----------+-----------+
| 05.01.2011 | 0.7       | 12.1      |
+------------+-----------+-----------+
| 11.01.2011 | 0.1       | 11.8      |
+------------+-----------+-----------+


This is measure value. 
+------------+-----------+-----------+
| startttime | value     | operatorid|  
+------------+-----------+-----------+
| 01.01.2011 | 7.7       | 1         |
+------------+-----------+-----------+
| 02.01.2011 | 17.1      | 1         |
+------------+-----------+-----------+
| 03.01.2011 | 6.2       | 1         |
+------------+-----------+-----------+
| 04.01.2011 | 7.7       | 1         |
+------------+-----------+-----------+
| 05.01.2011 | 17.1      | 1         |
+------------+-----------+-----------+
| 06.01.2011 | 6.2       | 1         |
+------------+-----------+-----------+
| 09.01.2011 | 7.7       | 1         |
+------------+-----------+-----------+
| 10.01.2011 | 12.1      | 1         |
+------------+-----------+-----------+
| 15.01.2011 | 6.7       | 1         |
+------------+-----------+-----------+

I need make summary table like this: 

+------------+-------+-----------+----------+-----------+
| startttime | value |  edittime |lim_lower | lim_upper | 
+------------+-------+-----------+----------+-----------+
| 01.01.2011 | 7.7   | 01.01.2011| 0.8      | 12.1      |
+------------+-------+-----------+----------+-----------+
| 02.01.2011 | 17.1  | 01.01.2011| 0.8      | 12.1      |
+------------+-------+-----------+----------+-----------+
| 03.01.2011 | 6.2   | 01.01.2011| 0.8      | 12.1      |
+------------+-------+-----------+----------+-----------+
| 04.01.2011 | 7.7   | 01.01.2011| 0.8      | 12.1      |
+------------+-------+-----------+----------+-----------+
| 05.01.2011 | 7.7   | 01.05.2011| 0.7      | 12.1      |
+------------+-------+-----------+----------+-----------+
...

I tried to use cmd JOIN in this content, but didn't work it. 

SELECT JX.*,JX_lim.* FROM JX JOIN JX_lim ON JX_lim.edittime <= JX.starttime

Do you have any idea?

Thanks

Pavel samek


-- 
View this message in context: 
http://old.nabble.com/joint-two-table-tp33228376p33228376.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to