coldfission Posted June 5, 2007 Share Posted June 5, 2007 SELECT orders.orders_id AS ID, last_modified AS modified, customers_company AS organization, customers_name AS name, customers_street_address AS address, customers_city AS city, customers_postcode AS zip, customers_state AS state, customers_country AS country, customers_telephone AS phone, customers_email_address AS email, payment_method, value AS total, 'tackwholesale.com' AS source FROM orders LEFT JOIN orders_total ON orders.orders_id=orders_total.orders_id WHERE orders_status=3 AND class='ot_total' UNION SELECT ID, modified, NULL AS organization, CONCAT(f_name, ' ', l_name) AS name, address, city, state, zip, country, phone, email, payment_method, total, 'tack-wholesale.com' AS source FROM tack_orders UNION SELECT NULL AS ID, NULL AS modified, NULL AS organization, CONCAT(f_name, ' ', l_name) AS name, CONCAT(street, ' ', street_con) AS address, city, zip, state, country, phone, email, NULL AS payment_method, NULL AS total, 'Catalog Request' AS source FROM cat_req_static I need to search this result using a WHERE clause. I tried putting this line after all of the above code: WHERE ID LIKE '%' But, this returns "Unknown column 'ID' in 'where clause'" How do i do this? Also, I need to count how many total records are returned by this query for my page numbering system. How would I COUNT all of this? thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.