You ca add a javascript function to concate list box value like this
function listBoxToString(listBox,all) {
if (typeof listBox === "string") {
listBox = document.getElementById(listBox);
}
if (!(listBox || listBox.options)) {
throw Error("No options");
}
var options=[],opt;
for (var i=0, l=listBox.options.length; i < l; ++i) {
opt = listBox.options[i];
if (all || opt.selected ) {
options.push(opt.value);
}
}
return options.join(",");
}
then You need to pass it to sql parameter
like @ListBoxValue , It should be string type.
after that you need to create a function to split this value or you can use IN Operator in sp login
like Select * from table
where id IN (@ListBoxValue)