We're Moving to a New Support Platform – Starting June 1st!

We’re excited to let you know that starting June 1st, we’ll be transitioning to a new support system that will be available directly on our product websites – Amelia, wpDataTables, and Report Builder. In fact, the new support platform is already live for Amelia and wpDataTables, and we encourage you to reach out to us there.

You'll always be able to reach us through a widget in the bottom right corner of each website, where you can ask questions, report issues, or simply get assistance.

While we still do not offer live support, a new advanced, AI-powered assistant, trained on our documentation, use cases, and real conversations with our team, is there to help with basic to intermediate questions in no time.

We're doing our best to make this transition smooth and hassle-free. After June 1st, this current support website will redirect you to the new "Contact Us" pages on our product sites.

Thanks for your continued support and trust – we’re excited to bring you an even better support experience!

Okay
  Public Ticket #1941989
Complex sql query error
Closed

Comments

  • Plasmid69 started the conversation

    Hi!

    I've tried to create a table from mysql query. the query works fine in phpmyadmin, on the same tables.

    When I enter the same query into the table creation it gives error: below.

    I've tried it with creating a view, but that also gives similar error.

    "
    Error

    cannot calculate position of (2ok) within Union all
    SELECT 2ok as Megállás_oka, count(2ok) as darab, sum(2p) as össz_idő FROM `l60_allasokok_idok` where date(kezdés_dátum) BETWEEN date('2019-02-26 07:30') and date('2019-03-04 05:00') group by 2ok)
    as okok_idok group by Megállás_oka"

    The query:

    "

    SELECT
    Megállás_oka as 'Megok',
    sum(darab) as 'Esetszám',
    sum(össz_idő) as 'Összidő'
    FROM (SELECT 1ok as Megállás_oka, count(1ok) as darab, sum(1p) as össz_idő FROM `l60_allasokok_idok`         where date(kezdés_dátum) BETWEEN date('2019-02-26 07:30') and date('2019-03-04 05:00') group by 1ok         Union all
    SELECT 2ok as Megállás_oka, count(2ok) as darab, sum(2p) as össz_idő FROM `l60_allasokok_idok`         where date(kezdés_dátum) BETWEEN date('2019-02-26 07:30') and date('2019-03-04 05:00') group by 2ok)
            as okok_idok
     group by Megállás_oka

    "

  •  2,576
    Aleksandar replied

    Hello Plasmid69.

    Can you, please, export the database that contain these tables from PHPMyAdmin and send it to me, so I can try it locally?

    Just make sure to enable the Private slider when you respond, so no one else can see it but us.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables