in reply to PERL DBI MODULE

They are three different queries because the COLUMN is different. They would each be prepared and executed separately.

If you are looking for how to prepare and execute a SQL query in general, you can check the dbi set of module best fit for your RDBMS.

Replies are listed 'Best First'.
Re^2: PERL DBI MODULE
by erix (Prior) on May 19, 2014 at 13:47 UTC

    You're right.

    Of course one could union several queries together, like so (assuming the same table t):

    ( select * from t where coln1='?' ) union all ( select * from t where coln2='?' ) union all ( select * from t where coln3='?' ) -- ... (etcetera)

    This way there is only one database/network trip. Of course, it can easily make the call side (application) more complicated and I wouldn't recommend it. But it's not so long ago that that performance gain could be irresistable.

      Of course, it can easily make the call side (application) more complicated

      Yep. To know which clause returned which data might require more work. Without the context, it's hard to tell.

      As for network usage, on queries that return more data, the sending is insignificant. But i think you already said that. :)