Want to avoid the particular rows from select join query... See description
Posted
by OM The Eternity
on Stack Overflow
See other posts from Stack Overflow
or by OM The Eternity
Published on 2010-05-13T10:36:17Z
Indexed on
2010/05/13
10:44 UTC
Read the original article
Hit count: 162
I have a Select Left Join Query whis displays me the rows for the latest changedone(its a time) column name ("field" should not be equal) column name ("trackid" should not be equal), and column name "Operation should be "UPDATE" ", below is the query I am talking about...
SELECT j1. *
FROM jos_audittrail j1
LEFT OUTER JOIN jos_audittrail j2 ON ( j1.trackid != j2.trackid
AND j1.field != j2.field
AND j1.changedone < j2.changedone )
WHERE j1.operation = 'UPDATE'
AND j2.id IS NULL
Now here I don't want a row to be displayed with a two particular column's value i.e. "field's value" the value is "LastvisitDate" and "hits"
Now if if append the condition in the above query that " AND j1.field != 'lastvistDate' AND j1.field != 'hits' " theni do not get any result...
The table structure is
jos_audittrail:
- id
- trackid
- operation
- oldvalue
- newvalue
- table_name
- live
- changedone(its a time)
I hope i have given the details properly If u still find something missing I will try to provide it more better way...
Pls help me to avoid those two rows with those to mentioned value of "field"
© Stack Overflow or respective owner