在sqlite中使用guid选择guid作为二进制文件存储在sqlite数据库中的位置 [英] Using guid in sqlite select where guid is stored in the sqlite db as binaries

查看:54
本文介绍了在sqlite中使用guid选择guid作为二进制文件存储在sqlite数据库中的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 SQLite 数据库中有一个表 Employee.其主键是 GUID 类型的ID".我尝试使用以下查询查找 id = guid 'a8828ddf-ef22-4d36-935a-1c66ae86ebb3' 的记录,但没有运气:

I have a table Employee in the SQLite database. Whose primary key is "ID" of GUID type. I try to find the record with id = guid 'a8828ddf-ef22-4d36-935a-1c66ae86ebb3' with the following query with no luck:

SELECT * FROM Employee
WHERE Employee.Id = 'a8828ddf-ef22-4d36-935a-1c66ae86ebb3'

谁能告诉我应该如何编写查询?

Can anyone tell me how should I write the query?

谢谢,

推荐答案

GUID 可能存储为二进制 blob;试试:

The GUID is probably being stored as a binary blob; try:

SELECT * FROM Employee
WHERE Employee.Id = X'a8828ddfef224d36935a1c66ae86ebb3';

这篇关于在sqlite中使用guid选择guid作为二进制文件存储在sqlite数据库中的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆