missing FROM-clause entry for table "???????"
See original GitHub issueIssue type:
[x] question [ ] bug report [ ] feature request [x] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[X] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[ ] latest
[ ] @next
[X] 0.x.x
(0.2.7)
Steps to reproduce or a small repository showing the problem: My test in pgAdmin4 SELECT “campaignId”, COUNT (“campaignId”) AS “totalCampaign” FROM public.??? WHERE “campaignId” = ANY (ARRAY [31,30,28,29,23,19,24,20,21,22]) GROUP BY “campaignId” it’s OK
const countContact = await this.???Repository.createQueryBuilder(‘???’) .select(‘???.campaignId’) .addSelect(‘COUNT(???.campaignId)’, ‘totalCampaign’) .where(‘???.campaingId = ANY(:data)’, {data}) .groupBy(‘???.campaignId’) .execute();
The query is wrong, Thank
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:15 (2 by maintainers)
Same issue:
As you can see, I have defined a
@JoinColumn
but it’s not getting respected. And the generated query’s inner join doesn’t have double quotes in it.Here is my entity definition:
I ma facing same issue, when trying to save entity with many2many relationship. This is the query its generating:
SELECT Campaign_businessGroups_rid.Business_Group_Id AS "Business_Group_Id", Campaign_businessGroups_rid.Campaign_Id AS "Campaign_Id" FROM "Business_Group" "Business_Group" INNER JOIN "Campaign_Business_Group" "Campaign_businessGroups_rid" ON (Campaign_businessGroups_rid.Campaign_Id = $1 AND Campaign_businessGroups_rid.Business_Group_Id = "Business_Group"."Business_Group_Id") ORDER BY Campaign_businessGroups_rid.Business_Group_Id ASC, Campaign_businessGroups_rid.Campaign_Id ASC'
This is the error I am getting:
QueryFailedError: missing FROM-clause entry for table "campaign_businessgroups_rid"