Answer the question
In order to leave comments, you need to log in
How to read the specified request?
In general, people, I don’t understand sql at all, recently one site fell into my hands, we will omit these details, I wanted to ask experienced people to help me read this query `SELECT 1 FROM `...', Array
It is possible that it's wrong in syntax, but I've been trying to figure out what it does for quite some time, please don't kick me, I'm just learning
Answer the question
In order to leave comments, you need to log in
SELECT is "SELECT"
1 is the field and value of the query result. As many lines will be displayed as there are records in the source. But in each line there will be one column without a name, the value in which will always be 1.
FROM is "FROM" - the definition of data sources. It is followed by tables and connections between them.
Example to understand:
SELECT
t1.name as User,
t2.number as Phone
FROM
Users as t1
LEFT JOIN Contacts as t2 ON t1.id = t2.Owner
This is a simple example of a fairly common left join query. It is important to consider that with full, left and right joins, you must always consider the possible null value in the fields
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question