Announcement

Collapse
No announcement yet.

[SOLVED] custom SQL statement in grid application does not work

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

  • [SOLVED] custom SQL statement in grid application does not work

    Hello,

    I have a following SQL statement and I would like to put it to the grid application. I tried but it immediately gives me an error. I tried this SQL statement in phpmyadmin and toad and it is working successfully. What is wrong with SC and how can I put this working

    select
    CASE STATUS
    when 'A' then 'READ'
    when 'U' then 'UNREAD'
    END as status,
    count(*) count
    FROM CONTACT_MESSAGE
    GROUP BY STATUS
    WITH ROLLUP

    At the grid on show, it says me following error
    Error
    Error while accessing the database:
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as count_1 from CONTACT_MESSAGE group by STATUS WITH ROLLUP LIMIT 0,27' at line 4
    SelectLimit(SELECT CASE STATUS when 'A' then 'READ' when 'U' then 'UNREAD' END as status, count(*) count as count_1 from CONTACT_MESSAGE group by STATUS WITH ROLLUP, 27, 0)

  • #2
    Perhaps:

    select
    CASE STATUS
    when 'A' then 'READ'
    when 'U' then 'UNREAD'
    END as status,
    count(*) as count
    FROM CONTACT_MESSAGE
    GROUP BY STATUS
    WITH ROLLUP
    Best regards: - Reinhard -

    I use ScriptCase 8 Enterprise Edition, Version 8.(latest)

    Comment


    • #3
      Thanx RHS, it is working now

      Comment

      Working...
      X