Announcement

Collapse
No announcement yet.

[SOLVED]Grid SQL is not inlcuding the DISTINCT word

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • [SOLVED]Grid SQL is not inlcuding the DISTINCT word

    In a grid, I have an SQL statement that includes the DISTINCT word. In debug mode, I can see that the SELECT COUNT(*) correctly includes the DISTINCT so the count comes out correct at (in my case) 45. However, the second SQL displayed, the one the grid is populated with, does NOT include the DISTNCT.. so I'm getting repeat rows in the grid and the number of records is of course too high (> 45).

  • #2
    Re: Grid SQL is not inlcuding the DISTINCT word

    Hello Boxer,

    Which RDBMS are you working with?

    regards,
    Bernhard Bernsmann

    Comment


    • #3
      Re: Grid SQL is not inlcuding the DISTINCT word

      FYI, I get this feature using mySQL 5.5

      Comment


      • #4
        Re: Grid SQL is not inlcuding the DISTINCT word

        I figured out the feature. Uhm, fixing the SQL makes it much better.

        Comment


        • #5
          Re: Grid SQL is not inlcuding the DISTINCT word

          I use MsAccess and I resolve these problem using a query or "view" in MySql dialect, then bind the grid to these query or View

          Aquiles

          Comment


          • #6
            Re: Grid SQL is not inlcuding the DISTINCT word

            Hello,

            I have reported this issue to our development team. I suggest you to create a View as aquiles said.

            regards,
            Bernhard Bernsmann

            Comment


            • #7
              Hi Bernhard

              Has this DISTINCT problem been fixed yet?

              I am trying to return a grid with DISTINCT records and as above, the count displays distinct but the query just drops it:

              (mysqlt): select count(*) from (select distinct (sec_users_and_groups_view.login), sec_users_and_groups_view.name, sec_users_and_groups_view.email, sec_users_and_groups_view.active, sec_users_and_groups_view.user_address, sec_users_and_groups_view.post_code, sec_users_and_groups_view.user_id_acc, sec_users_and_groups_view.group_login, sec_users_and_groups_view.group_id, acc_transaction_header.transaction_header_contact from sec_users_and_groups_view INNER JOIN acc_transaction_header ON sec_users_and_groups_view.user_id_acc = acc_transaction_header.transaction_header_contact where (sec_users_and_groups_view.group_id = '6') AND (acc_transaction_header.transaction_header_type = '1') AND (acc_transaction_header.inv_paid <> '1')) nm_sel_esp

              (mysqlt): SELECT sec_users_and_groups_view.user_id_acc as cmp_maior_30_1, sec_users_and_groups_view.name as sec_users_and_groups_view_name, sec_users_and_groups_view.user_address as cmp_maior_30_2, sec_users_and_groups_view.post_code as cmp_maior_30_3, sec_users_and_groups_view.email as cmp_maior_30_4 from sec_users_and_groups_view INNER JOIN acc_transaction_header ON sec_users_and_groups_view.user_id_acc = acc_transaction_header.transaction_header_contact where (sec_users_and_groups_view.group_id = '6') AND (acc_transaction_header.transaction_header_type = '1') AND (acc_transaction_header.inv_paid <> '1') LIMIT 0,102

              Many Thanks
              Kevin
              Best regards,
              Kevin

              Kevin Barham
              Promofinity.com

              Comment


              • #8
                Hello Kevin,

                I will contact our bugs team regarding this issue.

                regards,
                Bernhard Bernsmann

                Comment

                Working...
                X