This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15153|Reply: 0

[Source] Mysql table fields and variables are consistent workarounds

[Copy link]
Posted on 7/21/2016 10:22:23 AM | | | |


Stored procedure FileExist1:



Stored procedure FileExist2:





The execution result is as follows:

FileExist1 returns 8 pieces of data, FileExist2 returns 0 pieces of data,

Why does FileExist1 return 8 entries????? Because there are a total of 8 records in the table record, WHERE SHA1=SHA1 can be understood as where 1=1 is always true.

The solution to the consistency between table fields and variable names is to write in FileExist2:


Add the name of the table in front!






Previous:MVC Linq to SQL implements simple addition, deletion, and modification of pages
Next:Mysql universal pagination stored procedure
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com