Separation of long requests for readability / maintainability

I have inherited an Access database that has a query that SELECTs more than 50 columns. Even the MS Access graphical query design tool has too much information to handle IMO.

Quick disclaimer - I have programming experience, but practically no experience with databases.

For this specific task, I need data from 50+ columns. Is there a better way to get this information than one huge query?

I do not understand a little how to do this. The consensus on the Internet seems to be that SQL queries should be relatively small and well-formed. I just don’t see how to apply this principle when you need so many fields. Can I use many simple queries with UNION or INSERT INTO in a temporary table? Any suggestion or RTFM?

EDIT: Additional information about the application. Data spreads over 14 tables. I am collecting data to write it to an external file with 50 + fields per line (think about the CSV version for the spreadsheet).

EDIT: Managing and debugging SQL queries in MS Access seems to contain relevant recommendations.

+3
source share
5 answers

, -. 50 14 . , , . .

, 50 ( ), .

, , , , .

+1

50 .

, , 50+ , , . , , SQL-.

+1

, SELECT * FROM ....

0

50 , . , .

? , , SELECT , . .

0

If your data comes from multiple tables, you can use Generic Table Expressions to split the query into groups.

0
source

All Articles