i just can see the SQL query at \"Database\"->\"Show SQL Query\". How do I edit it in Crystal Report?
Firstly I think you need to provide what version of CR you are using.
Secondly, to the best of my knowledge in Version CR13 using VS2010, you CANNOT hand edit SQL query like it we could in older version of CR.
Only way to change it is to update the links/joins on the tables in the Database Expert and Verify Database. These joins will then reflect when you click "Show SQL query".
Thirdly, there is a way you can control the query yourself, using "SQL Command". The steps to do this is mentioned in the other solution.
First Right Click on Database Fields > Set Datasource Location > Select View which you want to replace with another.
I've recently upgraded to VS 2019 with Crystal Reports for Visual Studio 13 SP25. The right click "Edit Command" option wasn't there for me either but I know it was in the past. However I finally did get it by using a toolbar that was added and a "Select Expert Record" option. The same option should be under the "Report" menu in the full version of Crystal Reports.
For Crystal Reports 14.1.x, use Report (in menu at the top) ==> Selection Formulas ==> Record
You are looking for Edit Command
within the Database Expert ... see the screenshot below.