count

Implementing a visitor counter

I am a newbie and developing a website using ASP .Net 2.0 with C# 2005. I would like to add a facility to count the no. of visitors to my website. I have collected the basic informations to add this feature using Global.asax. I have made modifications to Web.config by adding the line "" under system.web section. I am using a table to k...

Select COUNT() from multiple databases in SQL

Hello, I am attempting to return the number of customers located in a specific state that have rented a specific movie, where the rents table contains two columns, one for customer ID and one for the movie ID. The function takes in a movie ID and the state and returns an integer with the amount of customers. Right now I have an implemen...

Efficient way to determine whether query will return "too many records" in SQL Server

I've got a search form that could potentially return thousands of records; I'd like to show a message if the query returns more than 500 or so and make the user refine the search to get fewer results. Am I stuck with doing a Select Count before running the actual query? What's the best practice here? ...

Informix SQL count() comparisons

I'm trying to build a SQL query that will count both the total number of rows for each id, and the number of 'FN%' and 'W%' grades grouped by id. If those numbers are equal, then the student only has either all 'FN%' or all 'W%' or a combination of both. I need a list of all the id's who only have stats of 'FN%' or 'W%' example id # 6...

VBA Code to Count all Columns that are numeric in ListBox containing SQL Query Results

This is in Access 2007. I have tried writing somethig like: Forms!MyForm!TextBox = Count(ISNUMERIC(ISNUMERIC(QueryResult.Reading))) But this returns non-numeric results. I have also tried: Forms!MyForm!TextBox = IIF(ISNUMERIC(QueryResult.Reading),Count(ISNUMERIC(QueryResult.Reading),"") Anyone have any ideas? I am lost. ...

Search for string and get count in VI editor

Well I want to search for a string and find number of occurrences in a file opened using Vi editor. ...

Countability Question (Theory)

I'm taking the GRE tomorrow, and had a question. Based on the answer key, this practice test states that the set of all functions from N to {0, 1} is not countable. Can't you map the natural numbers to these functions, as follows? i 1 2 3 4 5 6 7 8 ... f0 = 0 0 0 0 0 0 0 0 ... f1 = 1 0 0 0 0 0 0 0 ... f2 = 0 1 0 0 0 0 0 0 ... f3 = ...

XSLT counting elements with a given value

I need to count the number of elements in an XML file that have a particular value (to verify uniqueness). The XML file looks like this: EDIT: I updated the original "simplified" XML with the actual hairy mess someone designed. Unfortunately, this is going to make all the previous Answers really confusing and wrong unless edited. <root...

have a select and want to also retrieve count of the records

Dim db2 As New NewsDataContext Dim filter As String = "System" Dim Msg = From m In db2.Blog_Messages _ **From c In db2.Blog_Comments _** Join u In db2.users On m.userID Equals u.userid _ Where m.userID.Equals(filter) _ **Where c.MessageID.Equals(myRec) _** Group c By c.MessageID I...

Count Query in SQL

Hi. I am using SQL 2005. Table one, LinkedDocumentFolderTable, contains the names and information about the folders that hold linked documents. Table two, LinkedDocumentTable, contains the information about the linked documents themselves. The two tables are linked by the LinkedDocumentFolderID. I need the LinkedDocumentFolderID, De...

MySQL Help: SELECT table2.id WHERE ... table1.date is largest

I have 2 tables, using an inner join to query them. SELECT COUNT(table2.id) FROM table2 INNER JOIN table1 ON table2.relazioneid = table1.id WHERE table1.date > ? AND table1.date < ? It counts the ids of entries on reports between 2 dates. Table 1 holds info on the reports (date, groupid etc), table2 holds the entries on the reports...

How can I efficiently extract repeated elements in a Ruby array?

I have an array like [1,1,1,2,4,6,3,3] and I would like to get the list of repeated elements, in this case [1,3]. I wrote this: my_array.select{|obj|my_array.count(obj)>1}.uniq But it is tragically inefficient (o(n²)). Do you have a better idea? If possible concise. Thanks ...

count lines in a PHP project

Hi there I'm just curious. Do you know any tool which can count all the code lines from a PHP project? Many thx! ...

Discrepancies between “Mock” Database and “Real” database behaviours.

We use C# and Linq2SQL with a MS SQL Server Database. We have a mockdatacontext to carry out some unit testing. When testing we have discovered two different behaviours depending on whether the "real" or "mock" database is used. Scenario 1: Real Database There are 5 records in the database: db = realDatabase db.InsertOnSubmit(new re...

SQL CASE STATEMENT in COUNT CLAUSE

I'm trying to get a product's name and its number of sales from two separate tables. My tables look something like this: BOOK Book_ID | Book_Title | Book_Author SOLD Transaction_ID | Book_ID | Customer_ID I can get most of the results I want from the following query SELECT b.Book_Title, COUNT(s.Book_ID) FROM Book b, Sold s W...

In PHP can I get the total number of case statements in a switch statement?

Is there a way to return the total number of (case) instances there are in a switch statement? Something like this: $id = $_GET['id']; switch ($id) { case "item1" : $data = 'something1'; break; case "item2" : $data = 'something2'; break; } echo $data; But the reasoning for it is there are multiple files with these switc...

Google AppEngine: how to count a database's entries beyond 1000?

Duplicate of "how does one get a count of rows in a datastore model in google appengine?" I'm having big trouble. I want to know how many users I have... I did: users = UserStore.all() user_count=users.count() quite simple... But now I have more than 1000 users and this method continues to return 1000. Is there any other way of k...

Dynamic LINQ to Entity Count()

Hi, I'm trying to write the following short line of code in a more generic way. What I want to achieve is a simple count of records, that have changed or were created since a certain date. public int GetChanges(DateTime LastActivityDate) { KHS.Innopas.Web.Library.DataModels.Documentation.DocumentationEntities ctx = ...

How many modules are there in Spring? What are they?

just i want to know How many modules are there in Spring? What are they? ...

mysql count into PHP variable

Hi there, Let say that we have the following query: SELECT DISTINCT COUNT(`users_id`) FROM `users_table`; this query will return the number of the users from a table. I need to pass this value to a PHP variable. I'm using this: $sql_result = mysql_query($the_query_from_above) or die(mysql_error()); if($sql_result) { $nr_of_user...