Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

rsiedl's scratchpad

by rsiedl (Friar)
on Jun 02, 2004 at 15:20 UTC ( #359487=scratchpad: print w/replies, xml ) Need Help??

i have a database with the following:
Table structure (search_stats): +---------+------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+------------+------+-----+---------+----------------+ | id | int(11) | | PRI | NULL | auto_increment | | PMID | int(11) | | MUL | 0 | | | PMkey | varchar(4) | | MUL | | | | PMvalue | longtext | | | | | +---------+------------+------+-----+---------+----------------+ Sample data: +-------+----------+-------+---------+ | id | PMID | PMkey | PMvalue | +-------+----------+-------+---------+ | 27941 | 7321569 | MH | Female | | 27976 | 293324 | MH | Adult | | 27982 | 293324 | MH | Female | | 28039 | 1168727 | MH | Female | | 28164 | 4493249 | MH | Female | | 28165 | 4493249 | AD | Brazil | | 28206 | 5545272 | MH | Adult | | 28214 | 5545272 | MH | Female | | 28252 | 5841289 | MH | Female | +-------+----------+-------+---------+
can anyone suggest how i would write an sql statement to do something like:

select PMID from search_stats where MH="Female" and AD="Brazil"
(which should return just the PMID of 4493249)

* the above sql statement is just to demonstrate what i am trying to achieve
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (2)
As of 2023-12-07 03:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?