query

Query performance problem.

Hello everyone, I'm having troubles with certain query performance, i have the following 2 tables: CREATE TABLE `customers` ( `CustFullName` varchar(45) NOT NULL, `CustPassword` varchar(45) NOT NULL, `CustEmail` varchar(128) NOT NULL, `SocialNetworkId` tinyint(4) NOT NULL, `CustUID` varchar(64) CHARACTER SET ascii NOT NULL, ...

Calling a RESTful service with *many* parameters

WE are designing an iPhone app that will call back to a RESTful service running in Tomcat. We need to send many query parameters and have exceeded the maximum that the phone will allow. Would it be RESTful to use a PUT call with the parameters in the body, even though the intent in not to modify the server? A POST does not seem correct ...

Access 2003/2007 : Query to find average of one text field grouped by another in table

So lets say I have a table that looks something like this: ItemName ProductType ---------------------------------------------------------- Name1 Type1 Name2 Type1 Name3 Type1 Name4 Type2 Name5 Type3 and so on for thousands of recor...

What is the best way to integrate Solr as an index with Oracle as a storage DB?

I have an Oracle database with all the "data", and a Solr index where all this data is indexed. Ideally, I want to be able to run queries like this: select * from data_table where id in ([solr query results for 'search string']); However, one key issue arises: Oracle WILL NOT allow more than 1000 items in the array of items in the "in...

mysql id field just submitted

Ok, I find myself doing this often. I'll attach ids to my tables and I'll "link" the tables together. Just a simple example, a team roster might have categories. Each category has an id. When I add players into the roster, I'll assign them a category id as well to signify that they are part of that category. My question is, for this exa...

Select row matching a condition if no other rows match a different condition

Very basic, but didn't know what this type of query is called...I want a query that will basically do this (pseudo-SQL): SELECT name FROM Table WHERE activity_status != 'active' AND there are no rows with that same name where activity_status = 'active' (in other words, return names of the inactive only when not one with t...

How do I return multiple results in a SQL subquery?

I have a query below and would like to know if it is possible to get more than 1 result. I would like to get the 4 most recent entries. Thanks! select c.email,c.text,m.alertDataID from client_users as c, monitor_alerts as a, monitor_alerts_data as m where c.id=a.userID and a.alertID=m.alertID and m.alertDataID = (SELECT alertDataID ...

PHP: calculating birthday from age.

Yes, this may sound strange. In the advanced profile searching form, where you can filter by age. Now you would type 18 or some other age in the field. I am storing the birthdays, in the mysql db, in the birthday field in users i have example: 1990-02-02 How can i filter by age then, in a query? Should i first make a query before, m...

Android contacts api

I want to query commondatakinds.photo.photo for a specific contact id .. how should I put this? ...

Get latest comment records and the corresponding post slugs in Wordpress

I have the following query for getting the latest comments: global $wpdb; $sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,30) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->po...

Youtube support in google-api-java-client vs gdata-java-client

Hello, I'm trying to use the google-api-java-client (I suppose this is what is referred to as 2.0) for writing an android application for youtube. (gdata-java-client (1.x) does not support android, I understand). I have loooked through the youtube documentation as well as the sample provided in "youtube-jsonc-sample", which only queries...

one to many join - taking only the last one on the many part

I'm quite a newbie in EF, so I'm sorry if my question has been answered before.. I just can't figure out the syntax.. I have two entities, Category & Product, where one category has many products. I want to get all categories, with only their latest product (it has a date property named timestamp) I have no idea how to do that. :-/ I...

MySQL - How many people are NOT in a joined table?

I'm running the following query, which tells me which agents have ever been scheduled on a project at location 51: SELECT agents.agentid, agents.firstname, agents.lastname, schedule.projectid, projects.locationid FROM agents LEFT JOIN schedule USING (agentid) LEFT JOIN projects USING (projectid) WHERE (projects.locationid <=> 51)...

LINQ Query on ConcurrentDictionary of 19710 items slow

Hi All I have the following method: /// <summary> /// Calculates the last trade date. /// </summary> /// <param name="tradesDictionary">The trades dictionary.</param> /// <returns>The last trade date.</returns> public DateTime CalculateLastTradeDate(ConcurrentDictionary<Guid, TradeRecord> tradesDictionary) {...

WP – Content code keeps subpage from appearing in sidebar

In one of my wordpress templates, the content code seems to keep the subpage menu from displaying in the sidebar. When ever I remove all code from the content div, the subpage menu appears as expected. Could anyone point out where the code goes wrong? Any help would be greatly appreciated! <div id="content"> <div class="page...

Delete duplicate rows accoding to condition

I am using PostgreSQL database. I have the data like below. id name1 name2 modified_date - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 40 Balfe | Pat | 2010-10-01 17:48:44.804823 41 Battigan | David | ...

Using integers in text-query

I am indexing a table of companies, where a lot of them have names starting with an integer, e.g: 2partner 3m etc. But when I try to do a simple solr-query like "2partner" (in Solr's webinterface), the integer "2" is removed by the query parser. Here's the debug: <lst name="debug"> <str name="rawquerystring">2partner</str> <str name="...

SQL Query - select data from table A based on two fields in table B

I have two tables: A: [ date, step, status, ... ] B: [ date, step, name, ... ] I want to get result in form of [date, step, name] based on status parameter. I can easly get data from table A using following query: Select date, step From A Where status='1' and the result would be like: 1. 2010-09-12; 5 2. 2010-09-13; 3...

Wordpress query in CodeIgniter model

I have the following method in a CI model: function getPostTitle($post_slug) { global $post; $posts = new WP_Query('name=' . $post_slug); while ( $posts->have_posts() ) { $posts->the_post(); return $post->post_name; } } The returned variable is empty. Note that the same code works fine in a view. I need to be able to ...

transport-level error when specifying SELECT *

The following query does not work, and produces an error: A transport-level error has occurred when receiving results from the server SELECT * FROM table1 a, table2 b, table3 c WHERE a.location = b.location AND b.location = c.location AND a.id = c.id AND a.entry = ''34690'' Although this ...