Skip to content

Instantly share code, notes, and snippets.

doryokujin doryokujin

Block or report user

Report or block doryokujin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View get_combination_no-order.sql
SELECT n1.number, n2.number
FROM
(
SELECT number
FROM numbers
) n1,
(
SELECT number
FROM numbers
) n2
View men_&_women
id,gender
m1,man
m2,man
w1,woman
w2,woman
w3,woman
View gist:1719faa5e69d0f41fed6
number number
1 1
1 2
1 3
1 4
1 5
1 6
2 1
2 2
2 3
View result_combination_all
number number
1 1
1 2
1 3
1 4
1 5
1 6
2 1
2 2
2 3
View get_matching_mistake.sql
SELECT n1.id, n2.id, n1.id || '' || n2.id
FROM
(
SELECT id, gender
FROM men_and_women
) n1,
(
SELECT id, gender
FROM men_and_women
) n2
View result_matching_mistake
id id pair
m1 m2 m1 ♥ m2
m1 w1 m1 ♥ w1
m1 w2 m1 ♥ w2
m1 w3 m1 ♥ w3
m2 w1 m2 ♥ w1
m2 w2 m2 ♥ w2
m2 w3 m2 ♥ w3
w1 w2 w1 ♥ w2
w1 w3 w1 ♥ w3
View get_combination_not-same.sql
SELECT n1.number, n2.number
FROM
(
SELECT number
FROM numbers
) n1,
(
SELECT number
FROM numbers
) n2
View get_matching_correct.sql
SELECT n1.id, n2.id, n1.id || '' || n2.id
FROM
(
SELECT id, gender
FROM men_and_women
) n1
JOIN
(
SELECT id, gender
FROM men_and_women
You can’t perform that action at this time.