473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

getting 4 consective values in a query... this is interesting and hard

I have a table
"search_log"
that logs all search by client
here are some of the fields query_date , query_result, query_code

here is the thing as the owner of the site I want to be able to see a user that searched four times in a row that has no result to be able to save them and stop the from being disappointed

if a client searches and there is no result it automatically inserts a data like this
query_date = NOW(),
query_result = 0,
query_code = LIKE '%querystring%'


now i want to be able to find a client that has four "CONSECUTIVE" searches in a row that has four zero "0" query_result


i am looking for something like this


query_date = 10/11/2001
query_result = 0

query_date = 10/11/2001
query_result = 0

query_date = 10/11/2001
query_result = 0

query_date = 10/11/2001
query_result = 0

they have to be consecutive

by the way my table is having 3 million records so Can you please advice me a query that can run faster
Nov 2 '11 #1
1 1320
johny10151981
1,059 1GB
The Query should be like this

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM choosentable where query_result = 0 ORDER BY DATE Limit 0,4
  2.  
Nov 9 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. ...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
37
by: MLH | last post by:
For example: Nz(,0) returns "300" if the value in field is 300 (currency data type) and "0" if the value is zero or null. I get strings in the query output - they are all left aligned and I...
0
by: mrwoopey | last post by:
I did not see code for getting all values from a repeater control posted anywhere. So, I figured it out and I am posting for the next person that may need it (sorry if this seems obvious to you): ...
0
by: Anil Kumar Lakky Reddy | last post by:
I have seen lots of people complaining about not getting updated values from edit columns of datagrid. I had similar problem, I figured I was refreshing the data on each page load. I fixed it by...
2
by: MLH | last post by:
Have a data entry form bound to a table. Has a save button on it that launches DoCmd.RunCommand acCmdSaveRecord in Access 97. In the form after-update code, I have a line looking something like...
4
by: meendar | last post by:
Hi to all, I just need to get two fields from a table and manipulate the results in next query of a procedure.I planned to code like what you see below, create procedure marks1 as @ sql1 as...
8
by: jamesm6162 | last post by:
Hi I'm trying to create a view containing 3 fields, all from the same table. Here's what I have: SELECT MAX(dateField), field2, field3 FROM table1 GROUP BY field2, field3
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
14
by: toadmaster | last post by:
I am trying to remove any duplicate value and display just the unique values using the select query below. I need the select query to display just the distinct values based on Member.ID SELECT...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.