E
E
EVOSandru62015-07-31 07:32:51
PostgreSQL
EVOSandru6, 2015-07-31 07:32:51

How to just pull out one field with the maximum value from 2 different tables in postgres?

This is how it didn't work:

SELECT 
  MAX(t_places.sys_date_update) , 
  MAX(t_category_cargo.sys_date_update) 
FROM 
  t_places 
      JOIN 
  t_category_cargo;

An error occurs:
ERROR: syntax error at or near ";"
LINE 7: t_cargo;
^
********** Error **********
ERROR: syntax error at or near ";"
SQL state: 42601
Symbol: 116

Both tables exist in the database and have corresponding fields. Separately:
SELECT 
  MAX(t_places.sys_date_update) 
FROM 
  t_places ;

and
SELECT 
  MAX(t_category_cargo.sys_date_update) 
FROM 
  t_category_cargo;

Work out

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pesenka1, 2015-07-31
@EVOSandru6

read at your leisure

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question