I should also add, in this case what would t1 be? Is it an actual column or the actual table? I don't understand how to use this. Let me dump you some of my vitals here.
Table 1 is item_categories
item_category_id int(11) NO PRI NULL auto_increment
item_type_id int(11) NO MUL NULL
item_category_name varchar(255) NO 0
order_form_category tinyint(1) NO 0
Table 2 is order_forms
order_form_id int(11) NO PRI NULL auto_increment
order_form_name varchar(255) NO 0
order_form_category tinyint(1) NO NULL
I want to be able to get one result set that has records from both tables that match an order_form_category of 1 that is sorted alphabetically by order_form_name. In order to achieve this I can do a "select item_category_name as order_form_name" but I still need to discern which table the data came from. If I could somehow get the item_type_id from the table item_categories that would be great, but I don't know how to do that.
Here is what I've got so far, but it doesn't work because I am requesting three columns from item_categories and only two from order_forms
(select item_category_id as order_form_id, item_category_name as order_form_name, item_type_id from item_categories)
(select order_form_id, order_form_name)
where order_form_category = "1"