go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.22k stars 110 forks source link

Improving Document about SELECT clause. #359

Open Q00 opened 3 days ago

Q00 commented 3 days ago

Describe the bug There are no descriptions about using multiple WHERE clauses in the SELECT section. It’s common to use multiple conditions in queries, but this documentation lacks examples or explanations.

I found that using .AND in WHERE is described in the SubQuery section, but it should also be in the SELECT documentation.

image

Environment (please complete the following information): Docs

Code snippet

Expected behavior Please consider adding descriptions and examples of using multiple conditions with AND() in the SELECT section.

Let me know if you need any more help!

houten11 commented 2 days ago

You can find more info about expressions here: https://github.com/go-jet/jet/wiki/Expressions. Also, SQL doesn't support multiple WHERE clauses, it has to be only one.

Q00 commented 2 days ago

You can find more info about expressions here: https://github.com/go-jet/jet/wiki/Expressions. Also, SQL doesn't support multiple WHERE clauses, it has to be only one.

@houten11 Thank you for your prompt response. I understand that SQL does not support multiple WHERE clauses; rather, it uses a single WHERE clause with multiple conditions combined using AND, OR, etc. My concern is specifically about the lack of examples and explanations regarding this common usage in the SELECT documentation.

The SELECT section does not currently include examples or descriptions of how to use multiple conditions in the WHERE clause. There is an example in the Subquery section that uses AND, but it would be beneficial to have this information readily available in the SELECT documentation as well. Users often need to construct queries with multiple conditions, and having this information in the relevant section would make it easier for them to find and understand.

cc. @go-jet