Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Marker in UNION ALL


mark_roach - 11:32 am on Mar 8, 2010 (gmt 0)


You can just add a literal to each select.

eg.


SELECT '1' as marker, comment_by_member_id as id,comment_content as comment,comment_date as date FROM ibf_profile_comments
WHERE comment_for_member_id=1
UNION ALL
SELECT '0' as marker, com.member_name as id,com.comment_text as comment,comment_date as date FROM ibf_blog_comments com
LEFT JOIN ibf_blog_entries ent ON com.entry_id=ent.entry_id WHERE ent.entry_author_id=1

ORDER BY date DESC


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/4093105.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com