SQL QUERY how to fix this query i tried using full outer join but not working?

60 views
Skip to first unread message

Siva prabu

unread,
Aug 13, 2014, 9:46:25 AM8/13/14
to xamp...@googlegroups.com

Hi,

 

Kindly not the attachment


Order table:

 

createdate

ordernum

crid

7/1/2014 11:42

1-215469547

CR-1767416

7/18/2014 15:18

1-215582095

CR-75001134

7/12/2014 17:06

1-215549664

CR-3105087

 

SR Table:

 

createdate

srnum

crid

7/4/2014 11:05

1-215498021

CR-75001134

7/1/2014 4:14

1-215466713

CR-75001155

 

 

I need output like this

 

crid

ordernum

srnum

ordercreatedate

srcreatedate

CR-75001134

1-215582095

1-215498021

7/18/2014 15:18

7/4/2014 11:05

CR-75001155

 

1-215466713

 

7/1/2014 4:14

CR-1767416

1-215469547

 

7/1/2014 11:42

 

CR-3105087

1-215549664

 

7/12/2014 17:06

 

 

with the condition  order created month july  and sr created month july

siva.sql

Ahmed Khan

unread,
Dec 3, 2015, 9:36:13 AM12/3/15
to PHP Developers' Group, gsiva...@gmail.com
You can do this by

SELECT orders.crid,sr.srnum ,orders.createdate, orders.ordernum,sr.createdate AS srcreateddate  FROM orders LEFT JOIN sr ON orders.crid=sr.crid;

Wroking
Reply all
Reply to author
Forward
0 new messages