I have a table dbo.comp has id and name as columns.
dbo.comp
Name id
A 1
B 2
C 3
D 4
E 5
Where B &D is parent name inserted from excel sheet .
excelsheet
parent
B
D
I need to find out what are the Id’s for the parent names in dbo.comp. For that I stored parent which is present in the excel sheet into a array called parent[j]. And trying to compare with the id presents in the dbo.comp like this. But its not working
String Querystring7="SELECT Id from dbo.Comp where Id="+Parent [j]+" ";
am writing in java program I stuck writing query for this. How can I get parent name id from dbo.comp by comparing the parent[j] array? Please help me to write a query
Since you are storing the
NAMEin the Excel spreadsheet, you should be using thenameto query your table, not theID, as you are doing.Example: