Skip to content

[Question] Pagination with left join? #145

@Froidoh

Description

@Froidoh

Hello!

I am interested in using welds, but before I dive deeper, I find it difficult to find information about joins...

Can welds do queries like:

SELECT
    i.invoice_id,
    i.customer_id,
    i.invoice_date,
    i.total_amount,
    li.line_item_id,
    li.description,
    li.amount
FROM
    (SELECT
        id AS invoice_id,
        customer_id,
        invoice_date,
        total_amount
     FROM
        invoices
     ORDER BY
        invoice_date DESC
     LIMIT 10 OFFSET :offset) AS i
JOIN
    line_items li ON i.invoice_id = li.invoice_id
ORDER BY
    i.invoice_id, li.line_item_id;

?

Thanks in advance!

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