mysql - how to combine result of select statement to the other table with different database -


i'm having hard time combine result select statement other table different database.

this 1 of select statement , works fine:

database name "lis" table "legal_records"

select caseno,judicial_level,received_date,due_date, (select max(cast(due_date datetime)) legal_records subc subc.caseno=c.caseno group c.caseno) maxdue_date legal_records c 

result :

enter image description here

here other query , works fine:

database name : "pandimandata2002" table name : "tblcrew"

select caseno, lastname,vessel,status tblcrew pandimandata2002.dbo.tblcrew.caseno '%crw%' , (status not '%clos%' , status not '%settl%' , status not '%ca%cel%') , status '%court%' , clubcode '%tr%' 

result:

enter image description here

what want add column name "judicial_level" database "lis" table "legal_records" table "tblcrew" database "pandimandata2002" when caseno match other table.

i hope made myself clear! thank you..

select lr.judicial_level, tc.*  lis.dbo.legal_records lr inner join pandimandata2002.dbo.tblcrew tc  on lr.caseno = tc.caseno 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -