1) This is mostly an SQL question, although MySQL may have some trick up its 
sleeve that would help me.
2) I've searched the archives, and google
3) I've been using SQL for a long time, but can't think of a way to solve this
4) This may not be possible. :)

I am dealing with serial data that is being put into a table, and I have to 
search through that data to find certain "start words."  That is, data that 
indicates the start of a new packet of data.  This start word, since this is 
asynchronous serial data, could be split over rows.

For purposes of example, let us assume we have a table of four columns, and 
that my start indicator is "strt" in one column and "word" in the next 
column.  Now I want to find the next start word.  The first three cases are 
easy, I just do something like WHERE col1 = 'strt' AND col2 = 'word', etc..

But, what I need to be able to do is something like this:

SELECT unique_key_field FROM table_name
WHERE (col1='strt' AND col2='word')
OR (col2='strt' AND col3='word')
OR (col3='strt' AND col4='word')
OR (col4='strt' AND col1_in_the_next_row='word')

Is this even possible?  I'd hate to issue hundreds of queries to check if 
"strt word" is split across rows.

Should I investigate setting variables equal to the col4, and on a failed 
search, use that variable in the next query to see if the "old col4" pairs 
with anything in col1?

Or am I better off searching for the good case, and on failure, go and look 
for 'strt' in col4, then when I get a row, see if 'word' is in col1 on the 
next row (via another query)?

Ideas? Tips? Suggestions?

Thanks much!

j----- k-----

-- 
Joshua J. Kugler
Fairbanks, Alaska
Computer Consultant--Systems Designer
.--- --- ... .... ..- .-    -.- ..- --. .-.. . .-.
[EMAIL PROTECTED]
ICQ#:13706295
Every knee shall bow, and every tongue confess, in heaven, on earth, and under 
the earth, that Jesus Christ is LORD -- Count on it!


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to