Is it possible to have an INSERT from a reference table if something exists there?
Say this is the query to insert some data…
INSERT INTO `Test`.`Items` (
`Name` ,
`Type` ,
`Number`
)
VALUES (
'Pork', 'Sausage', 6
);
And that I have a lookup table called “Lookup” that contains two columns. “Type” and “Number”. What I want is that if something exists in the “Lookup” table in this instance for Type Sausage then to pull in the “Number” field from the lookup table instead of inserting the 6 in the INSERT statement.

Hope that is clear!
EDIT: Additional samples based on comments below.
Using
UNION ALLto string inserts together:Using a temporary table: