• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Group By and Order by in subquery

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

  • Group By and Order by in subquery

    I'm writing a DB source that requires subqueries. The central subquery requires the data to be grouped by and sorted by so that we don't get any odd results. I have tried to write it that way but for some reason, it's not liking that and says "Expected Semicolon or end of input but "(" found".

    I run the same code outside of NAB and it works fine but it's only when I try to put it in the NAB that it has issues. Is there a reason why it's not being accepted here?

    Here is this as a simplified example of our code:

    Code:
    select
    *
    from
    (
    SELECT
    t1.a,
    t1.b,
    t1.c,
    count(*) AS numcount
    FROM(
    SELECT
    t1.a,
    t1.b,
    t1.c
    FROM
    file1 AS t1
    GROUP BY
    t1.a,
    t1.b,
    t1.c
    order BY
    t1.a,
    t1.b,
    t1.c
    )
    GROUP BY
    t1.a,
    t1.b,
    t1.c
    ORDER BY
    t1.a,
    t1.b,
    t1.c
    )
    where
    numcount > 1

  • #2
    Hi,

    Thanks for the information and we will add it you our list.

    In the meantime I’d recommend creating a view for this so you can proceed.

    FYI, when you enter SQL in an SQL data source the front-end parses the statement so we can manipulate the statement for specific data requests etc.

    So that means we need to train our parser for all types of syntax and this must be something it doesn’t know about at this time.

    Comment

    Working...
    X