I'd like to know how to compare different column values in the same table

Asked 2 years ago, Updated 2 years ago, 63 views

There are two columns in one table, and I want to check only the ones with the same values.

For example, there are columns of seq1 and seq2, and these two columns have the same sequence value I want to extract it.

The value of seq1 column is 1, but I'd like to check only the value of seq2 is 1. What should I do?I don't know how to compare.

oracle

2022-09-21 12:43

2 Answers

The tag says it's Oracle. But... I don't think it's a big deal. demo

SELECT * FROM Table1
where "foo" = "bar"


2022-09-21 12:43

Self join with the same table, but shouldn't seq1 and seq2 be the same condition?

SELECT * FROM TABLE_A A JOIN TABLE_B B ON A.SEQ1 = B.SEQ2

Self-delete


2022-09-21 12:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.