[英]Sqlite select value as id to other table
I am working with SqLite, and I need connect table A with table B where the key is guid
written as ["guid"] (TEXT).我正在使用 Sqlite,我需要将表 A 与表 B 连接起来,其中键的guid
写为 ["guid"] (TEXT)。 How do I accomplish that?我如何做到这一点? (Should I use a substring value?) (我应该使用子字符串值吗?)
|name| value
|a | ["13889483-d92a-483e-9e16-471cb22b82a3","a7ced9c5-e7bc-4214-be77-a26d8f86844b"]
| name | value |
|13889483-d92a-483e-9e16-471cb22b82a3 | abc
You need to fix your table A so it is in First Normal Form :您需要修复表 A 使其处于第一范式:
Name Value
a 13889483-d92a-483e-9e16-471cb22b82a3
a a7ced9c5-e7bc-4214-be77-a26d8f86844b
Then you can connect the tables using a SQL join:然后您可以使用 SQL 连接连接表:
SELECT B.* FROM A
JOIN B ON B.Name = A.Value
WHERE A.Name = 'a'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.