As previously announced via banners and our newsletters, support is no longer available through this platform.

For easier navigation, you can still click on "Submit a Ticket" here, choose the appropriate category, and you'll be redirected to the correct support channel for your plugin.

You can still access your previous tickets and browse public tickets, but please note that responding to tickets is no longer possible.

Paid customers: Please log in to your store account for support.

Pre-purchase questions: Use the support widget in the bottom-right corner of our websites:
https://wpamelia.com
https://wpdatatables.com
https://wpreportbuilder.com

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