dir.by  
Поиск >>

Компьютер, программы
→
Microsoft SQL (Database Query Language)
 inner join, left join, right join, outter join в SQL запросе 
посмотрели 6486 раз
обновлено: 7 February 2019
Таблица Users
Id
Name
JobId
1
Женя
1
2
Слава
1
3
Коля
2
4
Петя
NULL
Таблица Jobs
Id
JobName
1
Microsoft
2
Apple
3
Sony
inner join SQL запрос
select Users.Name,Users.JobId,Jobs.JobName, Jobs.Id from Users inner join Jobs on Users.JobId=Jobs.Id
Результат SQL запроса
Name
JobId
JobName
Id
Женя
1
Microsoft
1
Слава
1
Microsoft
1
Коля
2
Apple
2
left join SQL запрос
select Users.Name,Users.JobId,Jobs.JobName, Jobs.Id from Users left join Jobs on Users.JobId=Jobs.Id
Результат SQL запроса
Name
JobId
JobName
Id
Женя
1
Microsoft
1
Слава
1
Microsoft
1
Коля
2
Apple
2
Петя
NULL
NULL
NULL
 
← Previous topic
Select projects where the number of tasks in the project is greater than or equal to 3 (Use group by, having count in a SQL query)
 
Next topic →
To make the values in the column non-repeating (add numbers to the duplicate names), use the update set in the SQL query
 
Your feedback ... Comments ...
   
Your Name
Your comment (www links can only be added by a logged-in user)

Новость "Черная пятница" Dreame в Беларуси – две недели скидок до 3400 рублей
 
SQL Examples
• Select projects where the number of tasks in the project is greater than or equal to 3 (Use group by, having count in a SQL query)
• inner join, left join, right join, outter join in a SQL query
• To make the values in the column non-repeating (add numbers to the duplicate names), use the update set in the SQL query
• How to use the SQL query to split a string into words using the delimiter in SQL Server ? Creating a Stored Function in SQL Server Management Studio
Simplify complex joins and subqueries in SQL
• Common Table Expressions (CTE) for simplify complex joins and subqueries in SQL
SQL Optimization
• Optimization, improvement of SQL queries

  Ваши вопросы присылайте по почте: info@dir.by