clear markdown compare help donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 497350 fiddles created (9578 in the last week).

CREATE TABLE billy ( my_id INTEGER, A0 VARCHAR, A1 VARCHAR, A2 VARCHAR, A3 VARCHAR, A4 VARCHAR ); INSERT INTO billy VALUES (1, 'A', 'B', 'A', 'C', 'A'), (2, 'A', 'A', 'A', 'A', 'A');
2 rows affected
 hidden batch(es)


SELECT * FROM billy;
my_id A0 A1 A2 A3 A4
1 A B A C A
2 A A A A A
 hidden batch(es)


SELECT * FROM billy WHERE A0 = A1 AND A0 = A2 AND A0 = A3 AND A0 = A4;
my_id A0 A1 A2 A3 A4
2 A A A A A
 hidden batch(es)


SELECT D.* FROM billy AS D WHERE EXISTS ( -- All columns except the last one SELECT D.A0, D.A1, D.A2, D.A3 INTERSECT -- All columns except the first one SELECT D.A1, D.A2, D.A3, D.A4 );
my_id A0 A1 A2 A3 A4
2 A A A A A
 hidden batch(es)


select d.my_id from billy as d cross apply ( values (d.a0),(d.a1),(d.a2),(d.a3),(d.a4) ) as x(a) group by d.my_id having min(a) = max(a);
my_id
2
 hidden batch(es)