Закрыть
×
=0) { let js = text.slice(pos1, pos2); + '<\/' + "script" + '>'; arrText.push(js); // next pos1 = pos2; continue; } } } break; } return arrText; } function OpenDialog(parentDiv, urlContent) { parentDiv = document.getElementById('modal-background'); // new !!!!!!! parentDiv.appendChild(document.getElementById('modal-template')); document.getElementById('modal-background').style.display = "flex"; // !!!!! block document.getElementById('modal-template').style.display = "flex"; // !!!!! document.getElementById('modal-body').innerHTML = ""; post_url(urlContent, "", function(text_from_server) { var element = document.getElementById('modal-body'); element.innerHTML = text_from_server; // add scripts var arrJSText = get_scripts(text_from_server); for (var i=0; i
dir.by
Праздники ...
Праздники ...
Рождество (Католическое) 25 Декабря
Концерты, выставки ...
Концерты, выставки ...
Детский мюзикл "Буратино.by"|||г. Минск 12 сентября, 4 октября, 25 октября, 28 ноября 2026
Афишу
Спорт занятия ...
Спорт занятия ...
Занятия в тренажерном зале
Спорт занятие
Компьютер, программы...
Компьютер, программы...
Объявления ...
Объявления ...
Бережная перевозка лежачих больных
Объявление
Новости ...
Новости ...
Форум ...
Форум ...
обсуждение...
<<
Поиск >>
Поиск
Концерты
Спорт
Форум
Компьютер
Компьютер, программы
→
Microsoft SQL (Database Query Language)
Выбрать такие проекты, где количество задач в проекте больше или равно 3 (Используем group by, having count в SQL запросе)
посмотрели
6362
раз
обновлено: 7 February 2019
Таблица
Projects
Id
ProjectName
1
Project1
2
Project2
3
Project3
4
Project4
Таблица
Tasks
Id
TaskName
Estimate
ProjectId
1
AAAAA for proj1
10
1
2
BBBBBB for proj1
6
1
3
CCCCC for proj1
2
1
4
EEEEEE for proj2
8
2
5
FFFFFF for proj2
9
2
6
IIIIIIIII for proj3
3
3
7
JJJJJJJ for proj3
18
3
8
KKKKKK for proj3
1
3
9
LLLLLLL for proj3
7
3
10
MMMMM for proj3
6
3
11
NNNNNN for proj4
2
4
Выбрать такие проекты, где количество задач в проекте больше или равно 3
SQL запрос
select
ProjectId,
count
(TaskName)
as
TaskCount
from
Tasks
group by
ProjectId
having
count
(TaskName)>=3
Результат SQL запроса
ProjectId
TaskCount
1
3
3
5
Next topic →
inner join, left join, right join, outter join in a SQL query
Your feedback ... Comments ...
Your Name
Your comment
(www links can only be added by a logged-in user)
+ Picture
Новость
"Черная пятница" 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