, - . , "", , created. , , PK section_entry_revisions Id.
Select ...
From section_entry_revisions As SER
Join section_entry_revisions_section_revision_fields As SRF
On SRF.section_revision_id = SER.Id
...
Where SER.sectionId = @SectionId
And SER.section_entry_id = @SectionEntryId
And SER.id = (
Select Max(SER1.id)
From section_entry_revisions As SER1
Where SER1.section_Id = SER.section_Id
And SER1.section_entry_id = SER.section_entry_id
Group By SER1.sectionId, SER1.section_entry_id
Having SER.created= Max(SER1.created)
)
"" section_entry_revisions.id, " ", .
, , , section_id, section_entry_id Id - ? Id ? , - ( )?
section_revision_fields, section_revision_fields. , , - section_entry_revisions . , , , , , . :
Select ...
From section_entry_revisions As SER
Join section_revision_fields As SRF
On SRF.section_id = SER.section_id
And SRF.section_revision_id = SER.section_revision_id
...
Where SER.sectionId = @SectionId
And SER.section_entry_id = @SectionEntryId
And SER.id = (
Select Max(SER1.id)
From section_entry_revisions As SER1
Where SER1.section_Id = SER.section_Id
And SER1.section_entry_id = SER.section_entry_id
)