I've got these columns [in a single table]:
partnumber
bin
description
store
manufacturer
I need to output the store and manufacturer as rows for each partnumber, bin, description column.
I've got these columns [in a single table]:
partnumber
bin
description
store
manufacturer
I need to output the store and manufacturer as rows for each partnumber, bin, description column.
Perhaps using a pivot or group by?
Your question is very vague, doesnt show much of table structure and doesnt list the RDBMS that you are using.
Consider editing your tags to include SQL, the database server you are using?
Matt
If my rewrite of the question is approximately correct, then it is still vague, but one possible interpretation of the required output is given by:
SELECT "store" AS tag, store AS name, partnumber, bin, description
FROM TheAnonymousTable
UNION
SELECT "maker" AS tag, manufacturer AS name, partnumber, bin, description
FROM TheAnonymousTable
This gives the store as a row and the manufacturer as a row for each partnumber, bin and description combination. And UNION, by default, eliminates duplicates. This is not an example of pivoting.
The chances are that this is not what is required - but the question should be revised to ensure that: