سؤال

I'm having trouble figuring out the missing expression from the following statement. What am I missing? Any help is greatly appreciated.

SELECT c.first || ' ' || AS "Name", s.start_date AS "PROB Start Date", s.end_date AS "PROB End Date", pc.con_freq AS "Frequency" 

FROM criminals c, sentences s, prob_contact pc 

WHERE c.criminal_id = s.criminal_id

AND s.violations BETWEEN pc.low_amt AND pc.high_amt;

As far as the JOIN goes it would be like this: (corrected statement)

SELECT c.first || ' ' || c.last AS "Name", s.start_date AS "PROB Start Date", s.end_date AS "PROB End Date", pc.con_freq AS "Frequency"

FROM criminals c JOIN sentences s ON c.criminal_id = s.criminal_id

JOIN prob_contact pc ON s.violations BETWEEN pc.low_amt AND pc.high_amt;
هل كانت مفيدة؟

المحلول

It is the very first expression:

SELECT c.first || ' ' || AS "Name", . . .
-------------------------^

Presumably you mean:

SELECT c.first || ' ' || c.last AS "Name", . . .

Also, you should learn to use explicit join syntax (although that has nothing to do with your problem).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top