The error message "ER_BAD_FIELD_ERROR: The column 'table.column' is not recognized in the 'on clause'" is displayed

I am encountering a perplexing issue... I'm attempting to execute a query:

SELECT ordenes_servicio.idorden, estatus_orden.descripcion AS estatus, tipo_orden.descripcion AS tipo_orden, usuario.nombre, ordenes_servicio.nombres_cliente, ordenes_servicio.fecha_asig 
FROM ordenes_servicio 
INNER JOIN estatus_orden ON ordenes_servicio.idestatus_orden = estatus_orden.idestatus_orden 
INNER JOIN tipo_orden ON ordenes_servicio.idtipo_orden = tipo_orden.idtipo_orden 
INNER JOIN usuario ON ordenes_servicio.id = usuario.id 
ORDER BY ordenes_servicio.idorden DESC

The issue arises when I attempt to execute it, displaying:

ER_BAD_FIELD_ERROR: Unknown column 'ordenes_servicio.idusuario' in 'on clause'

However, if you review the query, there is no instance of 'ordenes_servicio.idusuario'; even though there used to be, I have updated both tables, yet the query persists in trying to reference that column.

When executing the query on MySQL Workbench, it works, but not within my application... Can anyone provide assistance? :/

Note: My "app" actually functions as a REST API in typescript, utilizing the express library.

Answer №1

After some trial and error, I finally found the solution that may be helpful for someone starting out like me. It turns out that I was running three queries, and one of them still had "ordenes_servicio.idusuario" included... That was the issue. So always double-check your queries!

We all make beginner mistakes...

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Recovering specific data within a table in MySQL: step-by-step guide

If table A contains 3000 rows with the first 2000 rows being corrupt, and you have clean records stored in another MySQL server, what is the most efficient method to restore those 2000 rows? Thank you in advance. ...

Can you explain the parameters accepted by the Model.prototype.save() function in mongoose?

I am confused about the save function's callback in Mongoose. The documentation only mentions that it is an optional callback without providing any specific information on the parameters it accepts. This lack of clarity has left me wondering why Mongo ...

Troubleshooting problems when installing Angular and puppeteer

Recently, I started a fresh angular project with the goal of scraping data from a website and displaying it on my page. To achieve this, I thought of simply installing puppeteer via NPM after creating a new project. However, the compiler threw various erro ...

Node and Express are correctly logging the response, however the React frontend is logging an entirely different message

Currently, I am in the process of developing a form for an eCommerce platform that allows the administrator/owner to upload images to Cloudinary. At the moment, the image is being successfully uploaded to Cloudinary. Upon logging the response (using conso ...

Filtering nested arrays within an array with a condition object in typescript

My object array (in Json format) looks like this: var datas = [ { "Id": "1", // Includes 10 fields "tests": [ { "id":"1-1", "isSelected": true, }, { "id":"1- ...

Interfacing between a 504 error on a Node.JS frontend Azure AppService and a C# API backend Azure

We currently have a setup where our frontend communicates with an ExpressJS server, which then talks to a backend built on .NET 5. Both the frontend and backend applications are hosted on separate instances of Azure AppService. FE: https://my-front-end.azu ...

Encountering a Promise Rejection Error while initiating a fresh transaction segment in MongoDB

When attempting to initiate a new session, I encountered the following error message in the terminal: UnhandledPromiseRejectionWarning: TypeError: dbClient.startSession is not a function and further below: UnhandledPromiseRejectionWarning: Unhandled promis ...

Getting specific numbers from a URL path using regex

Trying to extract the numbers 123456 from three different URL paths: /aaa/bbb/co1-e3ee1ddd-3333s1-123456/art-1?unitId=art(1)par(5) /aaa/bbb/cos-123456/art-1 /aaa/bbb/cos-123456?unitId=art(1) Tried using (\d+) but it matches all numbers instead. ...

Why is the NodeJS Express app await statement only valid in an asynchronous function, even though this function is clearly asynchronous?

I wrote a function to check for the existence of a specific item in the database. I copied and pasted the logic used to retrieve data from the database and made some adjustments to the query object and return values. However, now it seems that node is not ...

Encountered a problem when attempting to upload images to Cloudinary through the front-end and save the information in a MySQL database using Axios on Node JS

I am currently working on a web application using React. I have implemented a form where users can input text data and upload multiple image files. The goal is to store the submitted images on Cloudinary along with other text data in a MySQL database. Unf ...

"Java's Prepared Statements: A Robust Tool for Secure

As I embark on my journey to learn how to write statements in Java, I came across prepared statements on Stack Overflow that include values. This got me thinking about how I could convert my current statement into a prepared statement. Here is the snippet ...

Implementing Redis as a session store appears to be ineffective

Modifying an existing app for Express 4.4.x Attempting to integrate a Redis session store by using the code snippet below: var express = require('express'); var session = require('express-session'); var RedisStore = require('conn ...

The utilization of 'fs' in the getInitialProps function is not permitted

Running into an issue while trying to access the contents of a parsed file within getInitialProps when my view loads. The error message "Module not found: Can't resolve 'fs'" is being displayed, and this has left me puzzled - especially cons ...

Issue with TypeScript createProgram due to undefined 'ts.sys' error

I am encountering an issue while trying to utilize the createProgram function. The error message states that ts.sys is undefined when running the following code: try { createProgram(Utils.getFileNames(), { lib: ['lib.es6.d.ts'] ...

Retrieve the revenue data from the past X days for every group

Below is the structure of my financials table: CREATE TABLE financials ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, CountryID VARCHAR(30) NOT NULL, ProductID VARCHAR(30) NOT NULL, Revenue INT NOT NULL, cost INT NOT NULL, reg_date TIMESTAMP ); ...

What is the process of mapping an array of object IDs in order to retrieve the corresponding objects associated with each ID

I currently have a specific collection that stores IDs referencing objects in a separate schema. If I'm working with an array containing these IDs, what is the best way to iterate through and retrieve the corresponding object? Although I've mad ...

TypeScript functions with Generic Constraints return specific values rather than just types

function createGenericCoordinates<Type extends number | string>( x: Type, y: Type ) { return { x, y }; } const genericCoordinates = createGenericCoordinates(1, 2); // Error (TS2322) // Type 3 is not assignable to type 1 | 2 genericCoordinates ...

What could be the issue with this query not functioning properly?

Below is the query that needs attention: SELECT e.id, e.name, u.x_account_username, ao.id FROM x_evidence e LEFT JOIN x_ambition_owner ao ON e.ambition_id = ao.id LEFT JOIN x_user u ON ao.profile_id = u.id WHERE e.updated BETWEEN '2014-03-19 10:16:0 ...

The defaultValue of the Observable TextArea is blank space following the transmission of a sendMessage using SignalR in a Typescript

i am currently in the process of modifying a basic SignalR Chat feature. Here is the situation: when a user sends a message, the message gets sent successfully. However, the textarea from which it was sent remains filled with empty space (aside from the p ...

Unidentified authorization token in React/Express

I've encountered an issue while implementing JWT authentication on a login/registration system. After a successful login/registration, I am setting a user token in localStorage. The problem arises when I inspect my localStorage and find that the user ...