Tuesday, January 25, 2011

Mysql joins query:

Mysql joins query:

SELECT oid,empid,name,title,date,start,close,duration,status FROM rept join emp where rept.empid=emp.empid and emp.manid=0071 order by oid desc limit 1,10;

Result of above query:

+-----+-------+---------------+-----------------------------+------------+-------+-------+----------+--------+
| oid | empid | name | title | date | start | close | duration | status |
+-----+-------+---------------+-----------------------------+------------+-------+-------+----------+--------+
| 48 | 1023 | Sriram | The Sentimentalists_5-12 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 47 | 1026 | Suresh | A History of marriage_1-26 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 46 | 1027 | Venkatesh | Bury Your Dead_12-23 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 45 | 4050 | Senthil | A History of marriage_22-54 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 44 | 1026 | Suresh | Bury Your Dead_122-155 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 43 | 4042 | Arul Raj | Bury Your Dead_2-300 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 42 | 1023 | Sriram | Bury Your Dead_1-6 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 21 | 4053 | Vetriselvan | A History of marriage_44-55 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 20 | 4042 | Arul Raj | A History of marriage_33-44 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
| 19 | 4049 | Senthil Kumar | A History of marriage_22-33 | 2011-01-25 | NULL | NULL | 00:00:00 | p |
+-----+-------+---------------+-----------------------------+------------+-------+-------+----------+--------+
10 rows in set

No comments:

Post a Comment