表x缺少FROM子句条目

时间:2019-09-06 09:21:54

标签: postgresql

我有一个错误,我无法将来自此查询的数据放入csv文件中。 错误是

  

表x缺少FROM子句条目

psql -t -A -F ';' -h localhost -U username -c "with x as 
(select created::timestamp(0), phone_number, from_addr, to_addr, price, 
completion_status_name from archived_order where ds_id = 510) 
select x.created, x.phone_number, x.from_addr, x.to_addr, x.price, 
x.completion_status_name order by x.created;" > someName.csv

1 个答案:

答案 0 :(得分:0)

psql -t -A -F ';' -h localhost -U username -c "with x as 
(select created::timestamp(0), phone_number, from_addr, to_addr, price, 
completion_status_name from archived_order where ds_id = 510) 
select x.created, x.phone_number, x.from_addr, x.to_addr, x.price, 
x.completion_status_name **from x** order by x.created;" > someName.csv