Always include the list in your responses. It will get you more results faster than if you have to wait on just me. - Shawn ----- Forwarded by Shawn Green/Unimin on 02/02/2005 04:53 PM -----
"Ferhat Bingol webmail " <[EMAIL PROTECTED]> wrote on 02/02/2005 03:55:36 PM: > Hi, > > This is a mode selection for a wind turbine measurement. > > This is the case I will check. I use php but do notnot take care of the > errors in it. I am just making a block diagram for my self now. > > $SQL=âSELECT name,mean FROM f_ssh WHERE (Mode=ââ) â; > > Result=mysql_query($SQL); > > While () > { > > > $pdate=date("YmdHis", strtotime("v[0] - 10 minutes")); > $pnext=date("YmdHis", strtotime("v[0] + 10 minutes")); > > > SQLp=âSELECT name, mean,mode FROM f_ssh WHERE name=$pdateâ; > SQLn=âSELECT name, mean,mode FROM f_ssh WHERE name=$ndateâ; > > While() > { > pdate=x[0]; > pmean=x[1]; > pmode=x[2]; > } > > > While() > { > ndate=y[0]; > nmean=y[1]; > nmode=y[2]; > } > > if (pmode=2) & (nmode=6) > { > if (v[1]<200) { new_mode=78;} > if (v[1]>200) { new_mode=4;} > } > if (pmode=6) & (nmode=2) > { > if (v[1]<200) { new_mode=9;} > if (v[1]>200) { new_mode=5;} > } > } > > > > > This is a multipart message in MIME format. > > > > "Ferhat Bingol webmail " <[EMAIL PROTECTED]> wrote on > 02/02/2005 > > 03:31:00 PM: > > > > > Hi all, > > > > > > I have case like this. > > > > > > > > > 200312211750 14.65 0 14.65 14.65 6 > > > 200312211800 118.9 119.41 14.65 697.17 > > > 200312211810 1324.1 122.6 697.17 1502.3 2 > > > > > > Last field is MODE. That case is at the middle of the database. But > > > these 3 are continues tripel. > > > > > > When MODE='' I need to know all the values of the previous and the > next > > > rows. > > > > > > Is there a SQL statement I can use, or do I need to write a code? > > > > > > Regards, > > > Ferhat > > > > > > Is there a way to do that > > > -- > > > > > > > > > > UNLESS you provide an "order" to your data, there is no concept > of "row > > before", or "row after" in SQL (excluding the CURSOR structure which > MySQL > > does not support, yet). Results are, unless explicitly sorted, > UNORDERED > > and are not guaranteed to appear in the same sequence even if you use > the > > same SQL statement against the same data. > > > > You can sort your results on one or more columns by using the ORDER > BY > > clause. However it is a function of your database connection library > (not > > the database server) to handle the results in some semblance of a > > sequence. That means that if you want to find a record in your query > > results then look at the records that occur just before and just > after, > > you will need to use a client-side recordset structure (what > programming > > language and connection library are you using?) to do that sort of > data > > navigation. > > > > There may also be other ways to approach this issue than through > recordset > > navigation. What problem(s) are you trying to solve? > > > > Shawn Green > > Database Administrator > > Unimin Corporation - Spruce Pine > > > > > > > > -- >