Okay
  Public Ticket #1061101
Empty table
Closed

Comments

  •  6
    Alex started the conversation

    Hello

    This query works in phpMyAdmin, вut it gives  empty table in the plugin

    select le.id, lead_id,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 34 ) strah,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 37 ) naim,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 36 ) inn


    from wp_rg_lead_detail l, wp_rg_lead le
    WHERE l.lead_id = le.id
    AND status='active'
    AND l.form_id = '12' or l.form_id = '18' or l.form_id = '14' or l.form_id = '15' or l.form_id = '16' or l.form_id = '17'
    group by lead_id


  •  6
    Alex replied

    Wow!

    This code works!


    select le.id, lead_id,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 34 ) strah,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 37 ) naim,
    (select value from wp_rg_lead_detail f where f.lead_id = l.lead_id and f.field_number = 36 ) inn


    from wp_rg_lead_detail l, wp_rg_lead le
    WHERE l.lead_id = le.id
    AND status='active'
    AND l.form_id in('12','18' ,'14' ,'15' ,'16' ,'17')
    group by lead_id



  • [deleted] replied

    Hi Alex,
    Thank you for the purchase and sorry for delayed replay.

    I am glad that you have found the solution. My recommendation is when you have complex queries to create MySQL View from that query in the database and then to use this MySQL View as table input.