Need to query a database for 12 million rows, process this data and then insert the filtered data into another database.
I can't just do a SELECT * from the database for obvious reasons - far too much data would be returned for my program to handle, and also this is a live database (customer order details) and I can't have the database ...
I am using JDO on google app engine. Each 'Employee' has a 'key'. I have a set of keys and wanted to retrieve all Employees whose key belongs to this set.
So I implemented it using the 'contains()' filter as specified here. The code works fine and looks like this -
List<Key> keys = getLookupKeys(....) ..//Get keys from somewhere.
Quer...
I have a field of type date in MySQL. When I try to insert any date in this field with PHP using following query, It stores 0000-00-00 in that field.
For example:
UPDATE test SET dob=2000-09-20 WHERE id=3
...
Hi,
I was following the documentation on FullTextSearch in postgresql. I've created a tsvector column and added the information i needed, and finally i've created an index.
Now, to do the search i have to execute a query like this
SELECT *, ts_rank_cd(textsearchable_index_col, query) AS rank
FROM client, plainto_tsquery('famille age')...
Table1:
Id MyFK f_name l_name
===========================
1 100 John Doe
2 100 Little Timmy
Table2:
Id MyFK item price
===========================
1 100 Car 200
2 100 Bike 100
In MySQL, how do I produce a table like this:
Id MyFK f_name l_name item price
================...
Lets say I have 2 tables:
1 with users
and another one which keeps record of which users used what codes.
Users
-----
Id, Name
1, 'John'
2, 'Doe'
Codes
------
Id, UserId, code
1, 1, 145
2, 1, 187
3, 2, 251
Now I want to pull a query that results he following
Name, UsedCodes
'John', '145,187'
'Doe', '251'
How can this be done wi...
I have a stored procedure that uses this select statement:
SELECT dbo.VendorProgram.id,
dbo.VendorProgram.CODE,
dbo.Programs.ProgramName
+ '-' + dbo.Divisions.Division
+ '-' + dbo.Vendors.Source
+ '-' + dbo.Mediums.Medium
+ '-' + dbo.VendorProgram.content
AS SourceDe...
I know that all of the domain aggregate functions are slow, but I am looking for the least of the evils.
Which will be the faster of the following two options?
Create a query that will group by the unique value and sum the total. Have dlookup to get my sum from the query.
Do a dsum on the main table with the criteria being the same as...
I have implemented analytics system which is now performing very poorly. To explain it I need to explain table structure queries
I have two innodb tables
Table1: Contains records about hourly stats (stats_id, file_id, time)
Table2: Contains over 8 million rows.
Table 2 structure is
full_stats (
stats_id Int
file_id Int
s...
Let's say I have a table like this called hours:
employee, payperiod, hours
greg, 1/31/2010, 12
greg, 1/31/2010, 15
mark, 1/31/2010, 10
mark, 1/31/2010, 11
greg, 2/28/2010, 12
greg, 2/28/2010, 15
greg, 2/28/2010, 4
How would I find the year to date hours for a given employee and payperiod?
For the above example I'd want to get to:
e...
I'm trying to query a word, for this Im using the db.query method. But I want use a where clause, I've done like this on my code, but, the emulator returns an error.
public String select(String wrd) {
String list = new String();
Cursor cursor = this.db.query(TABLE_NAME, new String[] {"word"},
"word like " + wrd + "", null, null...
The Foo column is defined as "Foo TEXT unique". Will an Eq().IgnoreCase() query use the index or will it perform a complete column scan?
The query:
string foo = "foo";
IList<T> list = session.CreateCriteria(typeof(T)).
Add(Expression.Eq("Foo", foo).IgnoreCase()).List<T>();
...
I'm relatively new to MySQL and I'm having no end of difficulty trying to work out how to do this. I've researched joining and such but I'm not really sure how to apply this.
I have three tables:
Artists Table
ID,
Name,
Description
Albums Table
ID,
Title,
Year,
Artist_ID
Tracks Table
ID,
Title,
Album_ID
Tracks are assigned to albums...
I have a table where I need to get the top n highest amount items for each Category.
Category Item InventoryCount
------- ----- -------------
Beverage milk 3
Beverage water 2
Beverage beer 9
Utensil fork 7
Utensil spoon 2
Utensil knife 1
Utensil spork 4
My desired output is the highest Inventory...
Say I have 3 queries. Query 1 returns a piece of information that Query 2 and Query 3 needs. Is there a way for Query 2 and Query 3 to access this piece of information from the result of Query 1?
Right now, I have Query 1 executing twice: once in Query 2 and once in Query 3. This doesn't seem efficient to me.
Is there a better way in M...
Hi friends,
I have used core data in my apps. My application works fine in online and offline mode . I have doubt about, how to write a query in Core data(Similar SQLite). I wrote a query and used in SQLite. But i want to know about, how to write a query(select, insert, update, etc,.) using core data. Please guide me and give me some us...
I am trying to perform a regex query using pymongo against a mongodb server. The document structure is as follows
{
"files": [
"File 1",
"File 2",
"File 3",
"File 4"
],
"rootFolder": "/Location/Of/Files"
}
I want to get all the files that match the pattern *File. I tried doing this as such
db.collectionName.find...
Hey guys, first time using stackoverflow.
can you guys help me debug?
Heres the problem, this query is selecting all of the rows from my database, its only outputting the first one twice for some reason.
$top10_query = "SELECT * FROM kicks";
$result = mysqli_query($cxn, $top10_query) or die("Couldn't execute query.");
$row = mys...
Hello.
I have simple problem. In my table have columns ID, NAME, CONTENT, TIMESTAMP. If i use session.query(table).all() result is array of table class objects. So i have no problem with modify one or more objects and update, or use this objects in associations. But i need only columns ID and NAME. If use session.query(table.id, table.n...
Hey guys,
I've got a certain question related to a blog, which I am developing in OOP (PHP) right now. All blogposts are stored in a MySQL-table.
In the app you can read a specific post by giving the id of the post via GET-parameter. So like http://example.com/?id=2. Under the blogpost I want to show to navigation links like "previous"...