Reputation: 303
Hello guys, maybe this is a basic SQL question. How can I combine multiple rows into one cell using SQL?
Expected Result:
Thanks in advance!
Upvotes: 0
Views: 324
Reputation: 49264
You can't do this in a query output, but you most certainly can do this in a report.
So, say this simple query of some City and Hotels:
However, a datasheet output is not suitable for formatted output, and thus you can (should) use a report, and that will allow you to group say the city together, and hide repeating values.
So, a report then can output the above like this:
And note that you can place a report (as sub form) into an existing form, so even if you not "reporting" the data but only for display, then once again, a report will allow such grouping.
As a general rule, data output to a datasheet view is not formatted, and such output is quite much only for developers. However, for your "users" of the application, then formatting such query output can and should be done with a report.
Upvotes: 1