0 - 5 of 5 tags for #syntax

Guys,

 

could you assist me in finding the mistake?

 

BEGIN TRANSACTION;

 

DECLARE MAX_DATE DATE;

 

SET MAX_DATE = (SELECT MAX(V_MONTH) FROM DB_TEMP.HISTORIAL_DATA);

 

SELECT * FROM DB_TEMP.HISTORIAL_DATA WHERE V_MONTH = MAX_DATE;

 

END TRANSACTION;

I'm trying to add a field from a different table to a derived query.  This is the first time I have tried to do this.  The query below was working unitl I added the bolded information below.  The error message is as follows:
SELECT Failed.  3707: Syntax error, expected something like ')' between 'soh' and '.'

I seem to be having trouble with a query that I inherited from another developer.  I'm told this is running a 99% skew. Would anybody be able to tell me what looks so skewed about this table?
 
create table ntl_prd_qmtmptbls.calls_tz_cw as (
select
cust_id,
cust_line_seq_id,
acss_call_dt,
call_start_tm,

I am trying to filter transactions that are less than 5 minutes apart.  In trying to develop this filter, I keep running into error messages.  The two columns I need to find the difference for are TIME datatypes:
(SEC.CALL_START_TM-PRI.CALL_END_TM) AS TIME_DIFF

Hello,
 
I have some code that I wrote that joins 2 separate tables:
 
SELECT
A.*,
B.MTN_1
 
FROM
TABLE_1 AS A
 
JOIN
TABLE_2 AS B
ON A.ACCT_NUM=B.ACCT_NUM
 
WHERE A.MTN=B.MTN_1