This project is read-only.
TypeProvider query DISTINCT COUNT case

Category:
TypeProviders.SqlDataConnection
Description: type provider sample: DISTINCT COUNT. Use the CreateFSharpSampleDatabase.sql to setup your database tables.
Code:

type T0 = Microsoft.FSharp.Data.TypeProviders.SqlDataConnection< "Data Source=localhost;Initial Catalog=FSharpSample;User ID=sa;Password=FSharpSample1234" >

let TypeProvider10() =
let db = T0.GetDataContext();
let q = query {
for n in db.Student do
join (for e in db.CourseSelection -> n.StudentID = e.StudentID)
distinct
count
}
printfn "distinct count = %d" q
Assert.AreEqual(q, 6)

Execution Result:
distinct count = 6
both elements are equal

Last edited Mar 1, 2012 at 8:01 PM by ttliu2000, version 2

Comments

No comments yet.