Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql how to get courses that i have made prerequisites

SET @courses_completed = '2';
SELECT c.course_id
FROM course c
LEFT JOIN course_prerequisites p ON p.course_id = c.course_id
WHERE NOT FIND_IN_SET(c.course_id, @courses_completed)
GROUP BY c.course_id
HAVING SUM(COALESCE(FIND_IN_SET(p.prerequisite_course_id, @courses_completed), 0) > 0) = COUNT(p.prerequisite_course_id);
Comment

PREVIOUS NEXT
Code Example
Sql :: Creating a comment and reply system PHP and MySQL 
Sql :: Jenkins SQLCMD run 
Sql :: sqlite3 not commit 
Sql :: mysql offset from bottom 
Sql :: sql implicit cursor 
Sql :: pgsql sum switch case 
Sql :: alter tablespace undotbs1 add datafile 
Sql :: mysql insert into select with recursive 
Sql :: power bi find all ids not in other tables 
Sql :: play framework connection via windows sql server 
Sql :: rails sql query converstion 
Sql :: sp help text in postgresql 
Sql :: mysql error 1215 
Sql :: sql query contains multiple ids 
Sql :: ring MySQL store binary data and special characters in the database after processing 
Sql :: lesser than or equal to symbol in postgres 
Sql :: SQL Equal to Operator (=) 
Sql :: how to map sql column to custom names 
Sql :: set mysql socket file docker windows 
Sql :: SQL IN Operator With Columns 
Sql :: left join vs inner join performance 
Sql :: ring MySQL execute a query on the database then print the result. 
Sql :: print $dbpass 
Sql :: from _sqlite3 import * ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. 
Sql :: sql date range 
Sql :: sql query to delete row by id 
Sql :: yesql 
Sql :: mybatis batch update oracle 
Sql :: delete duplicates based on 2 columns postgres 
Sql :: mysql docker image arjun 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =