Remove every helper column whose name starts with tmp_ (survey)
The export tool adds working columns named tmp_…, and their number changes. Remove all of them by rule.
- Level
- intermediate
- Time
- ~8 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Choose columns by a rule on their names, so new columns are handled on refresh.
Brightwater Council (fictional) exports survey results from a tool that leaves its working columns (tmp_…) in the file.
Steps
- Remove every column whose name starts with
tmp_(lower case, with the underscore). - Keep all other columns. New
tmp_columns can appear in future exports.
Your result must
- No column starting with tmp_
- Every other column kept
- Works when new tmp_ columns appear
Input
- Export (table)
- tmp_hash: text
- tmp_row: text
- Respondent: text
- Score: number
- Ward: text
Expected output columns
Respondent (text), Score (number), Ward (text)
| Respondent | Score | Ward |
|---|---|---|
| R1 | 8 | Ashford |
| R2 | 2812 | Millbrook |
| R3 | 3733 | Fairhaven |