Q: Mysql two select statements into one mark differences with column value OK I have two select statements
What i want to do is do this in one select statement with 
where im.alias_title =(in_image_alias_title OR a.user_id = user_id)AND a.approved = in_album_approved AND a.visible = in_album_visible;
I need to identify between the two results sets- is there a way to create another column value on the query for say it is a users album or it is an album that belongs to an image. An image can have multiple albums. Or it best to keep seperate
/* Select all albums associated with an image */
SELECT a.alias_title, a.title, a.hits, a.created_on, a.updated_on, a.updated_by 
FROM album a 
INNER JOIN album_image ai ON a.id = ai.album_id 
INNER JOIN image im ON ai.image_id = im.id
WHERE im.alias_title =in_image_alias_title AND a.approved = in_album_approved AND a.visible = in_album_visible;

/* Select a users albums */
SELECT a.alias_title, a.title, a.hits, a.created_on, a.updated_on, a.updated_by 
FROM album a 
INNER JOIN album_image ai ON a.id = ai.album_id 
INNER JOIN image im ON ai.image_id = im.id
WHERE a.approved = in_album_approved AND a.visible = in_album_visible AND a.user_id = user_id;


A: You can specify the filter criteria as you describe and use the result of boolean expressions to indicate which of the original query/queries the record was in:
SELECT a.alias_title, a.title, a.hits, a.created_on, a.updated_on, a.updated_by,
       im.alias_title = in_image_alias_title AS q1,  -- was included in 1st query
       a.user_id      = user_id              AS q2   -- was included in 2nd query
FROM   album       a
  JOIN album_image ai ON a.id        = ai.album_id
  JOIN image       im ON ai.image_id = im.id
WHERE  (im.alias_title = in_image_alias_title OR a.user_id = user_id)
   AND a.approved = in_album_approved
   AND a.visible  = in_album_visible

