About SQL request - Forum

Forum Navigation
You need to log in to create posts and topics.

About SQL request

Hi to Pro of SQL

I have made a search with Google ( but things were not so clear...to my poor mind)...
So, I want to know if this is correct :


Search in table "userinfos" in column "email"  AND in column "site"

Thank you

Uploaded files:
  • You need to login to have access to uploads.

You shouldn't repeat WHERE. :)

SELECT * from userinfos WHERE email like '%searchemailhere%' AND site like '%searchsitehere%'
CDY@44 has reacted to this post.
CDY@44

@cdy44-2

Search in table "userinfos" in column "email" AND in column "site"

You do not say what content (values) in columns "email" and "site", that you want to be searched e.g. ... everyone at gmail.com or websites ending in .es etc.

SELECT * from userinfos

... this is fine

WHERE email like 'blahblahlah' AND WHERE site like 'more blah'

... should be something like ...

WHERE email like 'blahblahblah' AND WHERE site like 'more blah'

... see https://www.w3schools.com/sql/sql_and_or.asp for more details

For detailed use of LIKE patterns, see ...

https://www.w3schools.com/sql/sql_like.asp
and
https://www.w3schools.com/sql/sql_wildcards.asp

... if you have difficulty understanding the special pattern characters, tell us what content you would like to match.

CDY@44 has reacted to this post.
CDY@44

Thank you Neodude2 and Gaev !

Yes ( WHERE email like 'blahblahlah' AND  site like 'more blah' ) that what I wanted to do.

Thank you for the links. There are a lot of interesting things to learn about SQL

Best regards,