Child pages
  • QBGroupBy

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary

...

Table Cell (td)
QBSelect

...

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
Divcache
styleindexdisplay:none

...

iddescription

...

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryGet query builder parent table clause, this may be a query or a join clause.

...

Table Cell (td)
QBSelect

...

padding0px
width80px

...

Get query builder parent.

...

...

Table Cell (td)
QBGroupBy

...

servoy sSummary12%30%58%height: 30px;

...

Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
QBGroupBy

...

3Methods SummaryAdd column name to group-by clause.

...

...

Table Cell (td)
QBGroupBy

...

Add column name to group-by clause.

...

Add the tables' primary pk columns in alphabetical order to the group by clause.

...

Table Cell (td)
QBGroupBy

...

servoy sDetail2Property Detailsparentnametd

parent

id

des

sIndent
Get query builder parent table clause, this may be a query or a join clause.
idtd
ret

Returns

divsIndentclients

classtd

Supported Clients

sIndent
SmartClient,WebClient,NGClientsam

Sample

idClear the to group-by clause.

HTML Table

propertyclass
Colgroup Tag
Column
padding0px
width100%
Table Row (tr)
style2100%height:30px;
Table Head (th)
colspan1
Table Body (tbody)
idid
Table Row (tr)
Table Row (tr)
Table Cell (td)
Div
class
Table Row (tr)
QBSelect
Table Row (tr)
idsam
Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/person>} */
	var query = databaseManager.createSelect('db:/example_data/person')
	query.where.add(query.joins.person_to_parent.joins.person_to_parent.columns.name.eq('john'))
	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)
Table Body (tbody)
idroot
Table Row (tr)
idname
Table Cell (td)
root
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get query builder parent.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
QBSelect
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/order_details>} */
	var subquery = databaseManager.createSelect('db:/example_data/order_details')

 /** @type {QBSelect<db:/example_data/orders>} */
	var query = databaseManager.createSelect('db:/example_data/orders')
	query.where.add(query
		.or
			.add(query.columns.order_id.not.isin([1, 2, 3]))

			.add(query.exists(
					subquery.where.add(subquery.columns.orderid.eq(query.columns.order_id)).root
			))
		)

	foundset.loadRecords(query)
Table Row (tr)
classlastDetailRow
Table Cell (td)

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

idadd-QBColumn
Table Row (tr)
idname
Table Cell (td)
add
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBGroupBy
Span
stylefont-weight: bold;
add
Span
(column)

...

iddes

...

classsIndent

Add column name to group-by clause.

...

sIdentjavascriptlastDetailRowrootname

root

dessIndent
Get query builder parent.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsaddname

add(column)

dessIndent
Add column name to group-by clause.

Same as query.groupBy().add(join.getColumn("value"))

...

prs

...

Parameters

...

...

sIndent

...

column

...

the column to add to the query condition

...

ret

...

Returns

...

sIndentclients

...

Supported Clients

sIndent

...

idsam

...

classlastDetailRow

...

idadd-QBFunction
Table Row (tr)
idname
Table Cell (td)
add
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBGroupBy
Span
stylefont-weight: bold;
add
Span
(function)

...

iddes

...

classsIndent

Add column name to group-by clause.

...

SmartClient,WebClient,NGClientsam

Sample

...

classsIndent

...

Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.groupBy.add(query.columns.orderid) // have to group by on pk when using having-conditions in (foundset) pk queries
.root.having.add(query.joins.orders_to_order_details.columns.quantity.count.eq(0))
foundset.loadRecords(query)

...

sIdentjavascriptlastDetailRowaddname

add(function)

dessIndent
Add column name to group-by clause.

Same as query.groupBy().add(join.getColumn("value"))

...

prs

...

Parameters

...

sIndent

...

function

...

the function to add to the query

...

ret

...

Returns

...

sIndentclients

...

Supported Clients

sIndent

...

SmartClient,WebClient,NGClientsam

...

classlastDetailRow

...

idaddPk
Table Row (tr)
idname
Table Cell (td)
addPk
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBGroupBy
Span
stylefont-weight: bold;
addPk
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Add the tables' primary pk columns in alphabetical order to the group by clause.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
QBGroupBy
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.groupBy.addPk() // have to group by on pk when using having-conditions in (foundset) pk queries
.root.having.add(query.joins.orders_to_order_details.columns.quantity.count.eq(0))
foundset.loadRecords(query)

...

classlastDetailRow

...

idclear
Table Row (tr)
idname
Table Cell (td)
clear
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
QBGroupBy
Span
stylefont-weight: bold;
clear
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the to group-by clause.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
QBGroupBy
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var q = foundset.getQuery()
q.where.add(q.columns.x.eq(100))
query.groupBy.clear.root.clearHaving()
foundset.loadRecords(q);

...

classlastDetailRow

...

Sample

...

classsIndent

...

Code Block
languagejavascript
/** @type {QBSelect<db:/example_data/orders>} */
var query = databaseManager.createSelect('db:/example_data/orders')
query.groupBy.add(query.columns.orderid) // have to group by on pk when using having-conditions in (foundset) pk queries
.root.having.add(query.joins.orders_to_order_details.columns.quantity.count.eq(0))
foundset.loadRecords(query)
sIdentjavascriptlastDetailRowaddPkname

addPk()

dessIndent
Add the tables' primary pk columns in alphabetical order to the group by clause.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
clearname

clear()

dessIndent
Clear the to group-by clause.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow