User Profile
Collapse
Profile Sidebar
Collapse
lsauravbi
Last Activity: Jun 20 '14, 07:43 AM
Joined: Mar 28 '14
Location:
-
I need the sum of all document of particular MIME type..but its should include only the latest version of document -
sql query latest version of document
I have this first query which gives the mimetype and sum of their total datasize and count of number of document
Code:SELECT MimeType, SUM(DataSize)/1024 as Total_Size_MB,count(DocID) as Total_No_Doc FROM DVersData group by MimeType
Code:SELECT DocID , MAX([Version]) AS [MaxVersion] FROM dversdata (nolock) GROUP
Last edited by Rabbit; Apr 18 '14, 03:16 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data. -
sql query to find latest version of stored document
I have table having column which stores documentid and another column storing the version of document.I want query to find out the only the latest version of document?
can any one help -
-
get result query
I have 1 table that store file MIME type info in 1 coloum and size of each file in another coloumn.
Please help me query to find the total size for each MIME type? -
lsauravbi replied to how to optimize the sql query the following query is running slow as i have used thein SQL Server@Luuk--thnks 4 reply this query is for sql server
I have used
Code:JOIN SubFolders AS M ON D.ParentID= M.dataid OR -D.ParentID= M.dataid
Leave a comment:
-
lsauravbi replied to how to optimize the sql query the following query is running slow as i have used thein SQL Server@lucck I tried to follow yours approach and replaced the code
with the following
Code:WITH SubFolders(dataID,ParentID,Name,Comment,SubType,Unit,lvl) AS ( -- Anchor Member (AM) SELECT DataID ,ParentID,Name,DComment, Subtype,(select name from llirimsuser.DTree(nolock) where dataid=ownerid) as 'Unit', 0 FROM llirimsuser.DTree (nolock) WHERE DataID = 28264085 UNION
Leave a comment:
-
lsauravbi started a topic how to optimize the sql query the following query is running slow as i have used thein SQL Serverhow to optimize the sql query the following query is running slow as i have used the
the following query is running slow as i have used the abs function in it
Code:WITH SubFolders(dataid,name,SubType,lvl) AS ( -- Anchor Member (AM) SELECT dataid, Name,subtype, 0 FROM llirimsuser.DTree (nolock) WHERE dataid = 28264085 UNION ALL -- Recursive Member (RM) SELECT D.DataID,D.Name,D.SubType,M.lvl+1 FROM llirimsuser.DTree (nolock) AS
Last edited by Rabbit; Mar 28 '14, 03:27 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
No activity results to display
Show More
Leave a comment: