How to use customized sql select statement in a grid?

Hi, if I remember right in SC 8.1 you can use your own sql queries in a grid. All the fields were generated from SC 8.1 depending on the sql select.

If I try that in SC9 it does not generate the fields automatically. BTW I try to use a sql select with JOINS so SC9 says gridfields undefined. Now if I try to add fields manually (e.g. mytable.user) SC9 deletes every manually added field after saving the grid !!??

What am I doing wrong?