Wednesday, 15 April 2015

php - Union multiple table with different column for order by date -


I search for a solution for this rake 's SQL because it does not work, like_supplier table and work as product table It is fine but when I add table comments that do not work, I know that the table is not the same column in the comment but how can I do this correctly? thank you in advanced. Select

from ``

  Select from DISTINCT * ((separate lp.customer_id, lp.`date`, lp.`classes`, lp.`product_id`) In the idle `like_product` LP, as' SP Where sp.`product_id` = lp.`product_id` and sp.`supplier_id` =". $ CUSTOMER_ID. ") UNION DISTINCT (separate ls.`customer_id` Select 'supplier_products` as `L',` date`, `ls form product_id`, ls.`classes`, as null` like_supplier` in the form of `comment`,` supply_products` as weak as SP Where sp.`supplier_id` = ". $ CUSTOMER_ID." And sp.` product_id` = ls.`product_id`) UNION DISTINCT (com.asender_id`, com.`date`, com.`product_id`, com.` Classes`, com.`comment` selection 'com As in comments`)) by a command as a.`date` desc  

Try to clear all aliases and name the column:

  select AIID, AA.Det, A.Product_ID, A.classes, from a.comment (( If you choose lp.`classes` in the form of a specific lp.customer_id id as 'id', date` as the product_id as lp.`product_id`, then the class like lp.`date` - Product 'LP Inner Join (SAP' Product_ID` = LP.`Product Select SP Pr` Splayr_prodkts on T_aid` or * where Apurtikarta_aidi = '. $ Customer_ID. ')) UNION DISTINCT (Select as LCI' customer_ID`), `` `` `` `` `` `` `` ` , Tap in the form of `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` Customer_id. '' Supplier 'products from selector as' tap' in the form of 'command' in the form of 'superplier' ) But sp.`product_id` = ls.`product_id` SP) in uni-different form (product_id as com.ciender_id` id, `date` as com, com.`product_id` as com.`date` Select In the form of classes' class`, com comment as' comment 'in the form of a comment)) as a command `` dt  

No comments:

Post a Comment