union query is not showing the result

Questionsunion query is not showing the result
vivek asked 10 years ago

Hi,

I am using union query, query is execute in phpmyadmin correctly and get result but when using in grid it's not showing the result can u plz help me???

Here is the query:

SELECT `customer_refer_id`,`first_name`,`last_name`,`zipcode`,`customer_territory`,
`customer_presence`,`open_quote`,`api_status`,`siebel_id`,`inbound_source`,`lead_generator`,`created_date`,`updated_date`,`work_phone_ext`,'' as `cust_hist_id`,'' as `insert_date`,'' as `cust_hist_status`,'' as `insert_by`,'' as `media_code`,'' as `product` from `lms_customer_details` UNION SELECT `customer_refer_id`,`first_name`,
`last_name`,`zipcode`,'' as `customer_territory`,'' as `customer_presence`,'' as `open_quote`,'' as `api_status`,'' as `siebel_id`,'' as `inbound_source`,'' as `lead_generator`,'' as `created_date`,'' as `updated_date`,'' as `work_phone_ext`,
`cust_hist_id`,`insert_date`,`cust_hist_status`,`insert_by`,`media_code`,`product` from `lms_customer_history`";

1 Answers
Abu Ghufran answered 10 years ago

You can try after enclosing this sql as subquery.

$g->select_command = "SELECT * FROM ( …………….. ) as o";

Place your query inside ( ).

Your Answer

3 + 18 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?