If you are working in the real-world application then you may frequently face scenarios where you have to compare data e.g. you get two lists of values and you want to know which values are common between two lists, which values only exists in the first list, and which values only exist in the second list. If the list contains just 5 to 10 values you can do it easily with your eyes but what is fun if a programmer doing the task manually. You should be able to leverage all the tools available to you to do this comparison reliably.
Ads 970x90
Tampilkan postingan dengan label Java Excel Tutorial. Tampilkan semua postingan
Tampilkan postingan dengan label Java Excel Tutorial. Tampilkan semua postingan
Kamis, 29 Juli 2021
Selasa, 27 Juli 2021
How to enclose a list of values into single quotes for SQL query? Microsoft Excel Example
Many times you get a list of values that you want to check in the database to confirm if they exist in your tables or to get more information bout them. For example, you got a list of 100 stocks and you want to check their last day closing prices in the database. The problem arises when values to be searched are Strings e.g. VARCHAR or CHAR because VARCHAR values need to be enclosed in the single quotes in most of the database like SQL Server, Oracle, or MySQL. If a number of values are less than 5 then it makes sense to add single quotes around them and separate them by comma manually so that you can use them on IN clause of your SQL query, but if it's more than 5 like 50 or 100 then manually enclosing them into single quotes will take a lot of time and most importantly programmers are not supposed to do such silly stuff manually.