Aravintha Bashyam.c
Aravintha Bashyam.c

Reputation: 110

How to check condition in a query.

I have two tables fdone, incident_one.

fdone contains four coloums.

 INC_KEY,LAT,LONG,FDID.

incident_one contains five coloums.

INC_KEY,LAT,LONG,STATE,FDID.

i making the fdone table LAT LONG two as four by this query.

SELECT S.`LAT `,S.`LONG `,(S.`LAT `+5)as x,(S.`LONG `-5)as Y FROM `fdheader` S

and then i get as

LAT,LONG,X,Y

and then by using join query.

i have to check as,

incident_one LAT AND LONG is inside LAT,LONG,X,Y.

i have to check as..,

S.LAT<LAT ,S.LONG<LONG,X>LONG,Y<LONG.

i have to check this condition by sql statement.

shall u help me for join query.

i need this needful help for join query.

join  using FDID

thanks in advances..,

Upvotes: 0

Views: 703

Answers (1)

user1697238
user1697238

Reputation:

may be it's help for you

SELECT * FROM fdone fd INNER JOIN incident_one io ON fd.FDID=io.FDID WHERE io.LATE IN (fd.LATE-5,fd.LATE) 
AND io.LONG IN (fd.LONG-5,fd.LONG) ;

Upvotes: 2

Related Questions