The query module is like a saved search in NetSuite.
N/query module to create and run queries using the Suite Analytics Workbook query engine.
Using the query module, we can:
- Use multilevel joins to create queries using field data from multiple record types.
- Create conditions (filters) using AND, OR, and NOT logic, as well as formulas and relative dates.
- Sort query results based on the values of multiple columns.
- Load and delete existing saved queries that were created using the Suite Analytics Workbook interface.
- View paged query results.
- Use promises for asynchronous execution.
- Convert query objects to SuiteQL queries and run arbitrary SuiteQL queries.
Multiple joins:
Workbooks and N/query support multiple levels of joins across records, as well as specific directional joins. This gives you much more flexibility and control when joining related records together in your results.

SQL query:
We can write your queries directly as SQL statements instead of using all the dropdowns and drag-and-drop UI. We can leverage this same query language in Suite Script by using the N/query.runSuiteQL() method.
myCustomerQuery.toSuiteQL();
