No such column error when column does exist

dcp3450

I have three tables: nanoProd, nanoFiles, and nanoRelFiles. Third table is used to store the file meta and how they relate to other screens.

I'm getting an error that a column doesn't exist when I know it does and I'm not sure why:

no such column: nanoFiles.fileLoc: 
SELECT 
prodTable.name AS prodName,
prodTable.intro AS prodIntro,
prodTable.prodText AS nanoText,
nanoFiles.fileLoc AS nanoFile
FROM nanoProd AS prodTable
LEFT JOIN nanoRelFiles on nanoFiles.rid = nanoRelFiles.file_id
LEFT JOIN nanoProd ON nanoProd.rid = nanoRelFiles.item_id
WHERE nanoRelFiles.scr_type = 'prod' AND nanoRelFiles.fileUse = 'list'
Chris Stillwell

You aren't joining to any table called "nanoFiles." You need to JOIN to that table to be able to SELECT from that column. Something like this:

FROM nanoProd AS prodTable
JOIN nanoFiles on ...
LEFT JOIN nanoRelFiles on nanoFiles.rid = nanoRelFiles.file_id

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

No such column error when column does exist

From Dev

column does not exist when it does

From Dev

Pg:Error column does not exist

From Dev

Column does not exist error when adding Foreign Key Django

From Dev

Postgresql error: Column does not exist when loging in with Spring

From Dev

Django Migration Error: Column does not exist

From Dev

SQL query column does not exist error

From Dev

PostgreSQL sql command error column 'does not exist'

From Dev

PostgreSQL: Error: column of relation does not exist

From Dev

SQL: error on invalid column name that does exist

From Dev

PostgreSQL "column does not exist" error in CartoDB

From Dev

How to fix Postgres error column does not exist?

From Dev

MySQL: query throwing column does not exist error

From Dev

ORM - rejection error: column "id" does not exist

From Dev

PSQL: "Error: column x does not exist"

From Dev

Hibernate: PSQLException: Error: Column "column_name" does not exist

From Dev

Select max column value when column value does not exist?

From Dev

Postgres column does not exist

From Dev

Column does not Exist in postgresql?

From Dev

Android sqlite query giving an error that column doesn't exist when it surely does

From Dev

ActionView::Template::Error (PG::UndefinedColumn: ERROR: column "weeknumber" does not exist

From Dev

pgadmin - an error has occurred, column "datconfig" does not exist

From Dev

ERROR: column "xxx" does not exist: Postgresql plpgsql stored procedure

From Dev

Postgres Inner Join Select query returns error: column does not exist

From Dev

ERROR: column of relation does not exist PostgreSQL ,Unable to run insert query

From Dev

PG::UndefinedColumn: ERROR: column comments.post_id does not exist

From Dev

PostgreSQL: row_number: ERROR: column "rn" does not exist

From Dev

PostgreSQL - ERROR: column does not exist SQL state: 42703

From Dev

Table name as PostgreSQL function parameter / ERROR: column ".." does not exist

Related Related

  1. 1

    No such column error when column does exist

  2. 2

    column does not exist when it does

  3. 3

    Pg:Error column does not exist

  4. 4

    Column does not exist error when adding Foreign Key Django

  5. 5

    Postgresql error: Column does not exist when loging in with Spring

  6. 6

    Django Migration Error: Column does not exist

  7. 7

    SQL query column does not exist error

  8. 8

    PostgreSQL sql command error column 'does not exist'

  9. 9

    PostgreSQL: Error: column of relation does not exist

  10. 10

    SQL: error on invalid column name that does exist

  11. 11

    PostgreSQL "column does not exist" error in CartoDB

  12. 12

    How to fix Postgres error column does not exist?

  13. 13

    MySQL: query throwing column does not exist error

  14. 14

    ORM - rejection error: column "id" does not exist

  15. 15

    PSQL: "Error: column x does not exist"

  16. 16

    Hibernate: PSQLException: Error: Column "column_name" does not exist

  17. 17

    Select max column value when column value does not exist?

  18. 18

    Postgres column does not exist

  19. 19

    Column does not Exist in postgresql?

  20. 20

    Android sqlite query giving an error that column doesn't exist when it surely does

  21. 21

    ActionView::Template::Error (PG::UndefinedColumn: ERROR: column "weeknumber" does not exist

  22. 22

    pgadmin - an error has occurred, column "datconfig" does not exist

  23. 23

    ERROR: column "xxx" does not exist: Postgresql plpgsql stored procedure

  24. 24

    Postgres Inner Join Select query returns error: column does not exist

  25. 25

    ERROR: column of relation does not exist PostgreSQL ,Unable to run insert query

  26. 26

    PG::UndefinedColumn: ERROR: column comments.post_id does not exist

  27. 27

    PostgreSQL: row_number: ERROR: column "rn" does not exist

  28. 28

    PostgreSQL - ERROR: column does not exist SQL state: 42703

  29. 29

    Table name as PostgreSQL function parameter / ERROR: column ".." does not exist

HotTag

Archive