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!
On
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.
You can use CONCAT function to add strings together using SQL, identify the names of the columns you want to merge together and write a query with this syntax: CONCAT(no, " ", add) you can us AS function to return the string in a new column you can define the name you want after