Mysql Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I have been working in php/oracle for quite some time now but recently had to shift myself to mysql and I am struggling with a particular query here.

Scenario is, certain researchers can submit their proposals and those proposal are stored in a table researcher. 
proposals are of 2 types lets say type 1 and type 2.
Later they can view their own submited proposals which is working fine, but there is one new condition now.What my client wants is that these researchers can view all proposals of type 2 but only those proposals of type 1 should be displayed to a researcher whose submit date is greater than a certain date lets say '2003-08-01'. Now how do I create a single query which can return me such results. I know there is a way with join but cant find a solution, with oracle I would have used sub query but that cannot be done on mysql so I need your guys help thanks

Table name: researcher

Concerned fields
pid <-- porposal id
rid <-- researcher id
ptype <--- proposal type
submitd <-- submission date.

I would use rid = 42 and for ptype = 1 submitd should be greater than '2003-08-01' and there is no restriction of date with ptype =2.

Thanks again.
if there is something not clear feel free to ask

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux