Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SQLDataSource and DISTINCT in selectClause

    I've just noticed that SQLDataSource counts records using COUNT(*) even if I specify a selectClause. I've specified:

    <selectClause>DISTINCT $defaultSelectClause</selectClause>

    so counting records using COUNT(*) is not correct.

    #2
    any feedback on this?

    same question here:
    http://forums.smartclient.com/showpost.php?p=41801&postcount=1

    Comment


      #3
      my bad, re-reading the other post and googling about group by vs distinct, I've just discovered that the problem is solved using a: <groupClause>$defaultSelectClause</groupClause>
      with <selectClause>$defaultSelectClause</selectClause>
      instead of
      <selectClause>DISTINCT $defaultSelectClause</selectClause>

      maybe a hint in the docs about sql datasource and paging for those not much proficient in sql queries...

      Comment


        #4
        after some practicing with the group by as an alternative to the distinct keyword, I think that a way to force the select clause to use the distinct would be nice :-)

        Comment


          #5
          no plans to support distinct in selectClause?

          I found a case where I'm using a customSelectExpression for a field with an inner select...so I can't use the groupClause.

          the only option is to use a inner select (in the table clause), but I'm joining several tables and so in this situation the filtering on columns from different tables will not work.

          Comment

          Working...
          X