# QueryDeleteRow

This function deletes a row from the query

## Method Signature

```
QueryDeleteRow(query=[query], row=[integer])
```

### Arguments

| Argument | Type      | Required | Description                      | Default |
| -------- | --------- | -------- | -------------------------------- | ------- |
| `query`  | `query`   | `true`   | The query to delete the row from |         |
| `row`    | `integer` | `true`   | The row index to delete          |         |

## Examples

### Implicit deletion of the last row

Builds a simple query and removes the last row by not specifying a row index.

```java
news = queryNew( "id,title", "integer,varchar", [ 
	{
		"id" : 1,
		"title" : "Dewey defeats Truman"
	},
	{
		"id" : 2,
		"title" : "Man walks on Moon"
	}
] );
queryDeleteRow( news );
writeOutput( news[ "title" ][ 1 ] );

```

Result: Dewey defeats Truman

### Deletes a specific row from the query

Builds a simple query and removes one of the rows.

[Run Example](https://try.boxlang.io/?code=eJxdjjELwjAUhOfkVxyZFLLUUXHrWgviVjoE%2B9RiTTR9MRTxv5u2OOh27%2B6%2Bx1mKPbZ4BPLDjuICqm00t9yR0klbpjN5%2FTT%2BeDE%2BWRWkeEkhUk1hjUyPeu6nU%2BUUaUBDJzLc4%2BDDzVglxVv%2FUKs%2FqjAW0XTXHs6icG5CZI3lRk7DcuqIae%2FSPJv2amRjFH3LVAa%2BB579Ct%2BfdZUqE%2F8BgdlAzA%3D%3D)

```java
news = queryNew( "id,title", "integer,varchar", [ 
	{
		"id" : 1,
		"title" : "Dewey defeats Truman"
	},
	{
		"id" : 2,
		"title" : "Man walks on Moon"
	}
] );
queryDeleteRow( news, 1 );
writeOutput( news[ "title" ][ 1 ] );

```

Result: Man walks on Moon

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJy1kLEKwjAQhufkKY5MKcRC01F0ad2khaKTOMQQsWCtjamliO%2FutcZBcXFw%2BiDff%2BG%2Fa2wfwQya1tg%2BMx0HpsROaCaAXZXVB2XFB1FtgJINJYSpiImBO08dMUq24mWlt55avtnYW08dD5ZuIZjSsU5qjsaZosZSDbYUIAfV2dKZtK3O%2FFk6qY9tdUqVU68YUwyC0NXL8uJ4MH5ne%2Fn7kn%2FecV9bDiXWiqeI%2BQwi5GQCAdwo%2BXIAKTCGc%2Fe3E%2BB7WCySvEiTfJ2thsAD54lxZQ%3D%3D)

```java
qry1 = queryNew( "a,b,c", "varchar,varchar,varchar", [ 
	[
		"a1",
		"b1",
		"c1"
	],
	[
		"a2",
		"b2",
		"c2"
	],
	[
		"a3",
		"b3",
		"c3"
	]
] );
queryDeleteRow( qry1, 2 );
writeDump( queryColumnData( qry1, "a" ).toList() );
qry2 = queryNew( "a,b,c", "varchar,varchar,varchar", [
	[
		"a1",
		"b1",
		"c1"
	],
	[
		"a2",
		"b2",
		"c2"
	],
	[
		"a3",
		"b3",
		"c3"
	]
] );
for( i = 3; i >= 1; i-- ) {
	queryDeleteRow( qry2, i );
}
writeDump( qry2.RECORDCOUNT );

```

## Related

* [QueryAddColumn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryaddcolumn)
* [QueryAddRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryaddrow)
* [QueryAppend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryappend)
* [QueryClear](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryclear)
* [QueryColumnArray](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnarray)
* [QueryColumnCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumncount)
* [QueryColumnData](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumndata)
* [QueryColumnExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnexists)
* [QueryColumnList](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycolumnlist)
* [QueryCurrentRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querycurrentrow)
* [QueryDeleteColumn](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querydeletecolumn)
* [QueryEach](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryeach)
* [QueryEvery](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryevery)
* [QueryFilter](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryfilter)
* [QueryGetCell](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querygetcell)
* [QueryGetResult](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querygetresult)
* [QueryInsertAt](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryinsertat)
* [QueryKeyExists](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querykeyexists)
* [QueryMap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querymap)
* [QueryNew](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querynew)
* [QueryNone](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querynone)
* [QueryPrepend](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryprepend)
* [QueryRecordCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrecordcount)
* [QueryRecordCount](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrecordcount)
* [QueryReduce](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryreduce)
* [QueryRegisterFunction](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryregisterfunction)
* [QueryReverse](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryreverse)
* [QueryRowData](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrowdata)
* [QueryRowSwap](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryrowswap)
* [QuerySetCell](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysetcell)
* [QuerySetRow](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysetrow)
* [QuerySlice](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/queryslice)
* [QuerySome](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysome)
* [QuerySort](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/query/querysort)
