# deleteReturning

inline fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>): ReturningStatement

Represents the SQL statement that deletes rows in a table and returns specified data from the deleted rows.

#### Return

A ReturningStatement that will be executed once iterated over, providing ResultRows containing the specified expressions mapped to their resulting data.

#### Parameters

returning

Columns and expressions to include in the returned data. This defaults to all columns in the table.

where

Condition that determines which rows to delete.

#### Samples

org.jetbrains.exposed.sql.tests.shared.dml.ReturningTests.testDeleteReturning

fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns): ReturningStatement

Represents the SQL statement that deletes all rows in a table and returns specified data from the deleted rows.

#### Return

A ReturningStatement that will be executed once iterated over, providing ResultRows containing the specified expressions mapped to their resulting data.

#### Parameters

returning

Columns and expressions to include in the returned data. This defaults to all columns in the table.

#### Samples

org.jetbrains.exposed.sql.tests.shared.dml.ReturningTests.testDeleteReturning

@JvmName(name = "deleteReturningNullableParam")
fun <T : Table> T.deleteReturning(returning: List<Expression<*>> = columns, where: SqlExpressionBuilder.() -> Op<Boolean>? = null): ReturningStatement

### Deprecated

This `deleteReturning()` with a nullable `where` parameter will be removed in future releases. Please leave a comment on [YouTrack](https://youtrack.jetbrains.com/issue/EXPOSED-494/Inline-DSL-statement-and-query-functions) with a use-case if a nullable condition cannot be replaced with the new `deleteReturning()` overloads.

#### Replace with

    deleteReturning(returning)

Content copied to clipboard