Course

And - SQL

We'll often need multiple steps to 'filtering' our data and results down. We can use multiple "WHERE" statements by using the "AND" statement.

SELECT * FROM Users WHERE age > 25 AND name="Jackie";
ID (INT)NameAgeEmailcreatedAtupdatedAt
2Jackie30jackie@email.com2024-04-17 21:10:522024-04-17 21:10:52

We can add as many "AND" statements as we need. Simply continue the pattern:

WHERE column = value
AND column2 = value2
AND column3  = value3
AND ...

For example:

IDNameEmailemailVerifiedCountryAge
1Amirsame@email.comFALSEINDIA25
2Jackiejackie@email.comTRUEINDIA30
3Andreaandrea@email.comTRUECANADA40
SELECT * FROM Users
WHERE age > 25
AND emailVerified = true
AND country = "INDIA";
IDNameEmailemailVerifiedCountryAge
2Jackiejackie@email.comTRUEINDIA30

0 Comments

"Please login to view comments"

glass-bbok

Join the Conversation!

Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.

Upgrade your account
tick-guideNext Lesson

Like - SQL