1. jaume
  2. Valentina Studio
  3. 金, 2月 22 2019, 04:39 PM
  4.  メールで購読
Hello,

I wan to summarize some columns on report footer, so I add summary control on report footer.
the column that I wanto to summary is TOTAL_FACTURA, so summary is sum(TOTAL_FACTURA)

Sql expression to run this report is
select com_ivacompres.id as idx , com_ivacompres.*, sup_proveidors.* from com_ivacompres, sup_proveidors
Where id_proveidor = sup_proveidors.id

When I click on preview valentina throw this error :
17:38:13 Page 1: Error( 1060 ) 42S21: "Duplicate column name 'ID'"
17:38:13 Page 1: SELECT * ,TOTAL_FACTURA AS InternalReportField0 FROM ( select com_ivacompres.id as idx , com_ivacompres.*, sup_proveidors.* from com_ivacompres, sup_proveidors
Where id_proveidor = sup_proveidors.id) as foo

If I remove this summary control, report runs fine.

Whats wrong ?
コメント
There are no comments made yet.
Sergey Pashkov 承諾済みの回答
Hello,

When the summary control is used the source query is executed as a subquery.
Tables com_ivacompres and sup_proveidors both have column ID.
MySQL doesn't allow to have columns with the same name returned from the subquery, so this error is generated.
But you can list necessary fields manually and assign an alias if necessary.
コメント
There are no comments made yet.
  • ページ :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 0 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories
Omegabundle
  1. 0 subcategories