Skip to content

Creating Where condition #16

@devanshusharma19

Description

@devanshusharma19

Hi,
can you help me for creating sql query in where condition

SELECT
*
FROM
classicmodels.offices t1
INNER JOIN classicmodels.employees t0 ON (t1.officeCode = t0.officeCode)
INNER JOIN classicmodels.customers t2 ON (
(t0.employeeNumber = t2.salesRepEmployeeNumber)
OR (t0.firstName = t2.contactFirstName)
)
WHERE
(t2.creditLimit > 70000)
AND (t2.creditLimit < 100000)
OR (t0.officeCode = 6)

ORDER BY
t0.firstName ASC

I am not able to create please tell me how to create AND or OR both condition in single query

WHERE
(t2.creditLimit > 70000)
AND (t2.creditLimit < 100000)
OR (t0.officeCode = 6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions