我有一个视觉狐狸专业SQL命令的问题,它不断给我错误,如“内部连接不存在”(当我把内联接,没有它它说,命令包含无法识别的短语/关键字,当我这样做选择
*!* SELECT * FROM ALTBREQU
*!* *--emp_ccodigo,req_cnumero,cen_ccodigo(codigo de centro de costo)
*!* SELECT * FROM ALTBDREQ
*!* *--emp_ccodigo, req_cnumero,pro_ccodigo,dre_ncantid,dre_ncosref
*!* SELECT * FROM ALTBPROD
*!* *--emp_ccodigo, pro_ccodigo, pro_cdescor
*!* SELECT * FROM COTBASOC
*!* *--emp_ccodigo,aso_ccodigo(unidad operativa),aso_cnombre
*!* SELECT * FROM CGTBCENT
*!* *--emp_ccodigo,cen_ccodigo,cen_cdescri
OPEN DATABASE dbalmacen
OPEN DATABASE dbcompras
OPEN DATABASE dbcontab
CREATE SQL VIEW prueba AS ;
SELECT * FROM ALTBREQU;
JOIN ALTBDREQ ON ALTBREQU.req_cnumero = ALTBDREQ.req_cnumero AND;
JOIN ALTBPROD ON ALTBDREQ.pro_ccodigo = ALTBPROD.pro_ccodigo AND;
JOIN CGTBCENT ON ALTBREQU.cen_ccodigo = CGTBCENT.cen_ccodigo
非常感谢你。
问候
答案 0 :(得分:3)
取出AND
语句中的JOIN
- 可让您使用INNER
:
CREATE SQL VIEW prueba AS ;
SELECT * FROM ALTBREQU;
INNER JOIN ALTBDREQ ON ALTBREQU.req_cnumero = ALTBDREQ.req_cnumero ;
INNER JOIN ALTBPROD ON ALTBDREQ.pro_ccodigo = ALTBPROD.pro_ccodigo ;
INNER JOIN CGTBCENT ON ALTBREQU.cen_ccodigo = CGTBCENT.cen_ccodigo