I have two tables 1- `FormTemplate` where the columns are Id, CreatedDate, Creator, Schema and 2 - `FormSubmissions` where the columns are Id, FormTemplateId(Foreign key), Created Date, Creator.
FormTemplate
| Id | CreatedDate | Creator | Schema |
|------------|------------------------|---------|---------|
| 1 | 2023-01-25 00:52:43.717| John | {} |
| 2 | 2023-01-25 00:52:43.717| Same | {} |
| 3 | 2023-01-25 00:52:43.717| Alee | {} |
FormSubmission
| Id | FormTemplateId (Foreign key)| CreatedDate | Creator |
|--------|-----------------------------|------------------------|------------|
| 1 | 2| 2023-05-25 00:52:43.717| Kyle |
| 2 | 2| 2023-02-25 00:52:43.717| Kayla |
| 3 | 3| 2019-03-08 00:52:43.717| Arthur |
| 4 | 3| 2019-02-25 00:52:43.717| Milli |
我想要所有的FormTemplate
排,最新的FormSubmission
排是6个月前的.在上表中:我应该只获得FormTemplate
中的第3行(ID=3
我无法创建查询,也无法找到有效获取具有此条件的FormTemplates的方法.