I have 3 tables in postgres containing information of the form:
<id, column1, column2, column3>
Now I intend to aggregate the 3 tables based on id, such that all the rows with the same id appear together. Is it feasible to do this in postgres with 3 tables. I also intend to store the clustered ids in a separate text file.
I know how to do clustering with 1 table..but I am not getting how to do clustering with 3 tables in postgres. Also I am not sure whether we can put the aggregated rows into a file. I googled with keywords like "postgres putting aggregate rows in text file", but I did not get an appropriate result.
Can someone please help me with this. Also I am a new to postgres, so pls excuse.
For example my input is:
#@<id1> <moon> <diamter> <x>
#@<id1> <moon> <closest_to> earth>
Now I want to do the following:
#@<id1> <moon> <diameter> <x>, <moon> <closest_to> <earth>
That is I want to GROUPBY id and store the above grouped by results in a file. Is it feasible to do this in postgres. If yes..then how?