Skip to content

Could || translate to concatenation? #1609

@MichaelChirico

Description

@MichaelChirico

`||` = sql_infix("OR"),

IMO it's almost always a mistake to use || to mean OR in an SQL context -- it would only make sense to use || on a 1-row table, vanishingly rare.

|| is standard SQL for "concatenation":

https://stackoverflow.com/a/1374512/3576984

Therefore I would find it very natural to use || for concatenation inside {dbplyr} queries too (paste0 has always felt clunky 😉).

Looks like ||OR has been true since time immemorial: 68186fc

But I don't see any discussion (admittedly, searching for an operator is hard).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions