select [WSS_Content_NEWSITE].[dbo].[AllUserData].tp_id, nvarchar1 as Title, float1 as ID, [WSS_Content_NEWSITE].[dbo].[AllUserData].tp_version as Version into temTab
from
(
select [WSS_Content_NEWSITE].[dbo].[AllUserData].tp_id, min(tp_version) as Version, tp_listID
from [WSS_Content_NEWSITE].[dbo].[AllUserData]
Where AllUserData.tp_ListID = 'B390923C-EC6C-428E-9704-1244EAD0144F'
group by tp_id, tp_listid
)
as Sub inner join [WSS_Content_NEWSITE].[dbo].[AllUserData] on AllUserData.tp_id = Sub.tp_id and Alluserdata.tp_version = Sub.Version and alluserdata.tp_Listid = sub.tp_listid
Select * from temTab
'B390923C-EC6C-428E-9704-1244EAD0144F' is your list's GUID
No comments:
Post a Comment