![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a table of items with about 50 columns, one of which is 'owner'. I would like to run several queries where the items for several 'owners' are to be treated as one owner. I have considered several options, but they all have problems: 1) Create a view. CREATE VIEW itemcombo AS SELECT 'Combined', [columns] FROM items WHERE owner IN (...); where [columns] is everything *except* owner? Is there a syntax for this command that would avoid typing all 50 columns? If I add a new column to underlying table, then view needs to be replaced? Is it possible to create this view in such a way that it could handle "normal" queries of the underlying table as well (where owner <> 'Combined')? |
|
2) Create a new owner 'Combined' and use "INSERT INTO table query" to |
|
3) Push the problem to user code. Every query contains "WHERE owner IN (...)" instead of "WHERE owner='Combined'". |
![]() |
| Thread Tools | |
| Display Modes | |
| |