Squirrel SQL 或 Oracle 是否可以在查询中为表名添加别名?
我正在将 Squirrel SQL 与 Oracle 结合使用。我经常必须为名称较长的表编写快速查询。如果我可以为它们提供别名并编写诸如“select * from ft where n='blah'”而不是“select * from footablelongname where nameField='blah'”之类的查询,那就太好了。
我不会在应用程序中使用这类东西,但对于即兴查询来说这会很好。
理论上,我想我可以为每个视图创建一个新视图,但如果能够在 Squirrel SQL 中执行此操作,那就太好了。
I'm using Squirrel SQL with Oracle. I often have to write quick queries for tables with longish names. It would be nice if I could give aliases to them and write queries like "select * from ft where n='blah'" instead of "select * from footablelongname where nameField='blah'".
I wouldn't use that sort of thing in applications, but it would be nice for off the cuff queries.
In theory I suppose I could create a new view for each one, but in it would be nice to be able to do this in Squirrel SQL.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以为此使用同义词,但我个人不会推荐它 - 当然,您可以节省一些字符输入,但对于以后维护代码的任何人来说,您的情况会变得更糟。
You could use synonyms for this, but I personally wouldn't recommend it - sure, you save a few characters typing, but you make things much worse for anyone maintaining your code later.
获取自动完成功能;-) Oracle 的免费 SQL Developer 有一个很好的功能工作一。
Get AutoCompletion ;-) Oracle's free SQL Developer has a nicely working one.
在“对象”选项卡中右键单击表名称,然后选择“复制对象名称”或“复制限定对象名称”并将其粘贴到 SQL 选项卡中。
In the "Objects" tab right-click on the table name and select "Copy Object Name" or "Copy Qualified Object Name" and paste it into the SQL tab.