我如何在查询期间从 Influx 中的两个表中获取特定行
How I get specific row during query from two tables in Influx
我尝试在下面的示例中向 Influx 数据库写入查询:
我有两个表:
table_1
id | value
1 | 100
2 | 200
table_2
id | value
1 | 900
2 | 800
我想使用一个查询来获取行:id 1 和 2 来自 table_1
以及 id 2 来自 table_2
查询中:
SELECT * FROM table_1, table_2 WHERE id=1 AND id=2
...我正在获取所有数据。
我试过:
SELECT * FROM table_1, table_2 WHERE table_1.id=1 AND id=2
...但它不起作用。
感谢帮助!
我使用了子查询,例如
SELECT * FROM (SELECT * FROM table_1 WHERE id='1' AND id='2'), (SELECT * FROM table_2 WHERE id='2') WHERE ...
我尝试在下面的示例中向 Influx 数据库写入查询:
我有两个表:
table_1
id | value
1 | 100
2 | 200
table_2
id | value
1 | 900
2 | 800
我想使用一个查询来获取行:id 1 和 2 来自 table_1
以及 id 2 来自 table_2
查询中:
SELECT * FROM table_1, table_2 WHERE id=1 AND id=2
...我正在获取所有数据。
我试过:
SELECT * FROM table_1, table_2 WHERE table_1.id=1 AND id=2
...但它不起作用。
感谢帮助!
我使用了子查询,例如
SELECT * FROM (SELECT * FROM table_1 WHERE id='1' AND id='2'), (SELECT * FROM table_2 WHERE id='2') WHERE ...