Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: using 'IN' clause in Class::DBI

by oha (Friar)
on Dec 05, 2007 at 09:48 UTC ( #655059=note: print w/replies, xml ) Need Help??


in reply to using 'IN' clause in Class::DBI

given a statement like
select * from mytable where id=1
if you want to extend your search to more then one id, but a list obtained from another query, you can
select * from mytable where id in (select id from table2)
As you can see, it's related to your db and not all dbms support it.

If i understood well, you want to "narrow" your search to a limited subset of artists, having no more data i'll write an example:

select * from album where artist in (search artistId in artists where +year = 1990)
Note that you can convert the IN clause with a INNER JOIN:
select album.* from album a, artists b where a.artist = b.artistId and + b.year = 1990
HTH

Oha

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://655059]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2022-01-26 11:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (69 votes). Check out past polls.

    Notices?