Answer the question
In order to leave comments, you need to log in
SQL query. How to display data from two tables?
There is a request -
SELECT * FROM users as A WHERE ( A.cash BETWEEN 0 AND 79.99) AND A.tariff = '15';
SELECT * FROM users as A WHERE ( A.cash BETWEEN 0 AND 79.99) AND A.tariff = '15';
a query to also display a phone from the phones table.
Answer the question
In order to leave comments, you need to log in
SELECT A.*,
B.mobile
FROM users as A
left join phones as B on B.login = A.login
WHERE ( A.cash BETWEEN 0 AND 79.99) AND A.tariff = '15';
does not work.
I will add.
In the phones table, you need to display the mobile column. The users and phones table has identical login columns
This query displays everyone who has less than 0, and with phones.
Maybe that will be clearer.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question