英文:
How to Create GI with SubQuery
问题
我有以下查询的GI要求 -
选择 * from Mtable M, OTable O where M.OrderId=O.OrderId and O.OpId in (选择 OTable OA where OA.OrderId=O.OrderId 中的最小(OpId))
英文:
I have requirement to for GI of following Query -
Select * from Mtable M, OTable O where M.OrderId=O.OrderId and O.OpId in (Select Min(OpId) from OTable OA where OA.OrderId=O.OrderId)
答案1
得分: 1
GIs无法执行子查询,但您可以从SQL视图创建一个GI:
- 在SQL Server管理工作室中创建您的视图。
- 在Acumatica中创建一个自定义项目。
- 从您的SQL视图创建一个DAC,如下所示:
- 将您的CREATE VIEW SQL脚本添加到项目中作为SQL脚本(不要忘记在顶部添加DROP VIEW语句)。
- 现在您可以将此项目发布到任何位置,并在通用查询中使用SQL视图DAC。
英文:
GIs are unable to do subqueries, however you can create a GI from a SQL View:
- Create your view in SQL Server management Studio
- Create a customization project in Acumatica
- Create a DAC from your SQL View as follows
- Add your CREATE VIEW SQL Script into the project as a sql script (don't forget to add a DROP VIEW Statement in the top)
- You can now publish this project anywhere and use the SQL View DAC inside of a generic inquiry
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论