我无法从以下陈述中找出缺失的表达方式。我错过了什么?非常感谢任何帮助。
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;
就JOIN而言,它将是这样的:(更正后的陈述)
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;
答案 0 :(得分:4)
这是第一个表达式:
SELECT c.first || ' ' || AS "Name", . . .
-------------------------^
大概你的意思是:
SELECT c.first || ' ' || c.last AS "Name", . . .
此外,您应该学习使用显式join
语法(尽管这与您的问题无关)。