我可以存储“别名”吗?我使用 SQLite 时的信息?

发布于 2024-09-19 00:50:53 字数 720 浏览 4 评论 0原文

我有一个脚本可以解析 xml 文件以自动生成 SQLite 表。并且,简化的命令如下。

Table string CREATE TABLE IF NOT EXISTS benchmark (id integer primary key autoincrement,Version float, CompilationParameters_Family text, CompilationParameters_XilinxVersion text, CompilationParameters_Device text, CompilationParameters_XilinxParameterList_Parameter_OptimizationGoal text, CompilationParameters_XilinxParameterList_Parameter_PlacerEffortLevel text)

它工作得很好,但我想知道是否可以为数据库中的长名称附加一些别名。

这可能吗?我的意思是,我可以有一个类似的命令

Table string ... CompilationParameters_XilinxVersion tex >>as version<< ...

,以便在检索数据时可以使用 CompilationParameters_XilinxVersionversion 吗?

I have a script that parses xml file to generate SQLite table automatically. And, the simplified command is as follows.

Table string CREATE TABLE IF NOT EXISTS benchmark (id integer primary key autoincrement,Version float, CompilationParameters_Family text, CompilationParameters_XilinxVersion text, CompilationParameters_Device text, CompilationParameters_XilinxParameterList_Parameter_OptimizationGoal text, CompilationParameters_XilinxParameterList_Parameter_PlacerEffortLevel text)

It works well, but I wonder if I can attach some aliases for the long name in a database.

Is this possible? I mean, can I have a command something like

Table string ... CompilationParameters_XilinxVersion tex >>as version<< ...

so that I can use CompilationParameters_XilinxVersion or version when retrieve the data.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

和影子一齐双人舞 2024-09-26 00:51:54

你想要做的事情在 SQL 中是不可能的。但是,您可能希望创建一个 VIEW 来简单地替换长列名和短列别名。请注意,sqlite 中的 VIEW 是只读的,因此不能被写信给.

What you're trying to do is not possible in SQL. However, you may want to create a VIEW that simply substitutes the long column names with your short column aliases. Note that VIEWs in sqlite are read-only and therefore cannot be written to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文