I am new to catalyst and need guidance in fetching some data from my
mysql db.

I want to know how can I write below queries(1&2)

Here is
dummy table structure I am using.

-------------------------------------------------
 table1
 =======
 qid
sid status name
 __PACKAGE__->set_primary_key("qid");

__PACKAGE__->belongs_to("queq_dump", 'MYAPP::Schema::Result::Table2,
{qid => 'qid'});

-------------------------------------------------

table2
 pid eid qid name
 primary_key ==
pid+qid+eid
-------------------------------------------------

 QUERY 1

=======
 select A.qid, A.name, A.name from table1 A, table2 B 
 where 

A.qid = B.qid 
 and A.sid = 1
 and B.pid != 2

 QUERY 2
 =======
 select
A.qid, A.name, A.name from table1 A, table2 B 
 where 
 A.qid = B.qid
and B.eid = (select min(eid) from table2 where table2.status = 1)
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to