1

I know there was another thread asking how to select max of one column distinct with another column. However, I need code which selects max of one column distinct with another column and another table.

All the examples creating a t1 and t2 do not work if you have a second table you have to input in the from. For example:

Colors (Table 1): Pigments (Column 1), Lights (Column 2)

Time (Table 2): Hour (Column 1), Minute (Column 2)

So, if I wanted to get the Max() Hour for only Pigments, how would I go about doing that?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
daekimtx
  • 11
  • 1
  • Sample data and desired results would really help. What is the relationship between the two tables? – Gordon Linoff Jun 01 '18 at 02:22
  • I think you'd better to add a FK to colors: `Colors(Pigments, Lights, TIME_ID REFERENCES Time); Time(id, hour, minute)` – DDS Jun 01 '18 at 11:02

0 Answers0