Aggregate Functions in Installer SQL
I am trying to use aggregate function in Installer database query. Something like,
but it is failing miserably. Help needed!!!
[font="verdana, geneva, helvetica"]
SELECT MAX(`DiskId`) FROM `Media`
but it is failing miserably. Help needed!!!
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
captain_planet
14 years ago
....I suppose a crude method would be something like:
....the media table is sorted by default on the DiskId column, but other tables/fields probably wont be, and hence you'd keep the ORDER BY clause.....
Dim highestDiskId : highestDiskId = 0
Dim sql : sql = "SELECT `DiskId` FROM `Media` ORDER BY `DiskId`"
Set mediaView= Session.Database.OpenView(sql)
mediaView.Execute
Set mediaRecord = mediaView.Fetch
While Not mediaRecord Is Nothing
highestDiskId = mediaRecord.StringData(1)
Set mediaRecord = mediaView.Fetch
Wend
MsgBox highestDiskId
....the media table is sorted by default on the DiskId column, but other tables/fields probably wont be, and hence you'd keep the ORDER BY clause.....
Posted by:
pjgeutjens
14 years ago
Posted by:
anonymous_9363
14 years ago
http://msdn.microsoft.com/en-us/library/aa372021%28VS.85%29.aspx
I'm determined to make this Google thing catch on, you know. You people won't stop me!
I'm determined to make this Google thing catch on, you know. You people won't stop me!
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.