-1

以下のクエリを実行するとエラーが発生し、問題を特定できませんでした。誰でも助けてもらえますか?

SELECT shifts.consultant_uid AS consultant_uid, shifts.status AS 
status , shifts.pay_roll_no AS pay_roll_no, shifts.week_ending AS week_ending, shifts.shifts_date AS shifts_date, shifts.description AS description, shifts.units AS units, shifts.pay_rate AS pay_rate, shifts.charge_rate AS charge_rate, shifts.pay_amount AS pay_amount, shifts.charge_amount AS charge_amount, shifts.margin_amount AS margin_amount, shifts.client_name AS client_name, consultant.user_name AS consultant_name, 

FROM a_shifts AS shifts

LEFT JOIN a_users AS consultant ON shifts.consultant_uid = consultant.user_uid
WHERE 1 

AND week_ending >=  '2013-03-17'
AND week_ending <=  '2013-03-24'
4

3 に答える 3

0

これを試して

SELECT shifts.consultant_uid AS consultant_uid, shifts.status AS 
status , shifts.pay_roll_no AS pay_roll_no, shifts.week_ending AS week_ending, shifts.shifts_date AS shifts_date, shifts.description AS description, shifts.units AS units, shifts.pay_rate AS pay_rate, shifts.charge_rate AS charge_rate, shifts.pay_amount AS pay_amount, shifts.charge_amount AS charge_amount, shifts.margin_amount AS margin_amount, shifts.client_name AS client_name, consultant.user_name AS consultant_name

FROM a_shifts AS shifts

LEFT JOIN a_users AS consultant ON shifts.consultant_uid = consultant.user_uid
WHERE 1 

AND week_ending >=  '2013-03-17'
AND week_ending <=  '2013-03-24'
于 2013-03-19T12:47:21.953 に答える
0

SELECT句のフィールド リストの最後に余分なコンマがあります。

... consultant.user_name AS consultant_name,

一般的なアドバイスとして、通常、実際のエラーはクエリ内のどこでエラーが発生したかを示します。ほとんどの場合、それが示す場所は問題の直後FROMです。これは、クエリが解析できなかった最初のもの (この場合はキーワード) がエラーを生成するためです。

于 2013-03-19T12:18:49.163 に答える
0

FROM 句の前の , を削除

SELECT .........consultant.user_name AS consultant_name,
FROM 
于 2013-03-19T12:22:19.053 に答える