0

I have a table T like this:

ID | column 1 | column 2 |...| column n

Here ID is not a primary key.
I performed some operation and group the results according to ID so I get a table T1 like this:

ID | column 1 | column 2 |...| column x

Now some IDs which were present in T are eliminated in T1 due to above operation.
Now I want to again do some operation on T, and again want to group result according to ID but only those IDs which are listed in T1.
How can I do it in MySql ?

Happy Mittal
  • 3,667
  • 12
  • 44
  • 60

1 Answers1

-1

What kind of operation you performed?

If you join these two tables simply create an alias for each id like that

SELECT t.id AS id_1, t1.id AS id_2 FROM t LEFT JOIN t1 ON ......

then you have ids from both tables id_1 from table T and id_2 from table T1

demsey
  • 130
  • 2
  • 6