Get the App
SLTechnology News&Howtos  ›  Database  › 

Reason for invalid column index in sql

Shulou Source: shulou.com Published: 2022-05-31 23:51:13 10月04日 Update

This article mainly introduces the sql invalid column index reasons, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

The reasons for invalid column index in sql are: 1, placeholder is not consistent with the number of parameters; 2, sql splicing error, note that each [%] should be included with ['], spliced with parameters with [| |]; 3, incorrect comments.

The reason for invalid column index in sql:

It is almost certain that this error is generally caused by low-level mistakes, please pay attention to check your own sql spelling

According to the problem pointed out on the Internet, it is not the same as your own mistake, and finally it is normal after removing a comment.

I'm using idea, annotated with ctrl+/, that is, sql before--

Somehow it didn't work, but it became the source of the error.

In this record to prevent yourself from forgetting, several other possible spelling mistakes are as follows

1. The placeholder is inconsistent with the number of parameters

For example, when there is a placeholder? , but pass in two parameters # {a}, # {b} here

2.sql splicing error

For example, the splicing of fuzzy query condition a

A like'%'| | # {a} | |'%'

Note that each% should be included with''and with parameters by | | stitching

Of course, you can also write a like CONCAT (CONCAT ('%', # {a}),'%')

3. Incorrect comments

This is what happened to me. I passed the unused sql and commented it out.

However, the comments did not take effect normally, resulting in the emergence of invalid column indexes. It will be fine after deletion.

Of course, there may be other reasons for this.

Thank you for reading this article carefully. I hope the article "reasons for invalid column Index in sql" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Error comment reason list parameter article consistent situation quantity low-level no two that is value interest and at the same time by more friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Docker NVidia Apple Huawei