query

jquery and part-find names

I have many INPUT tags with the following name structure: name="menu:popSearch:chk0" name="menu:popSearch:chk1" name="menu:popSearch:chk2" name="menu:popSearch:chk3" and so on. What jQuery will give me the INPUT 's that follow this structure. (It's to run the sites http://BiblePro.BibleOcean.com and http://BahaiResearch.com) ...

Trouble with Codeigniter Routes involving a query

Hey SO, I'm having a little trouble with a CodeIgniter route when there is a query (stuff after the ?) in the URI. I know it is good practice to replace queries with routes in CI, but I'm importing in a premade messageboard that already does everything with queries. This is my route: $route['messageboard/:any'] = "messageboard/index"...

Linq Query Expression reuse

Post Edited Would this be possible ? Have a query expression that is precompiled i.e private static Func<SmwrDataContext, int, IQueryable<Xyz>> _validXyzs = CompiledQuery.Compile((Context context, int Id) => from xyz in _db.XYZs join abc in _db.ABCs on xyz.Id equa...

MySQL Beach Ball from NOT IN query

I have two queries that each return a list of node ids SELECT node.nid FROM dpf_node AS node WHERE node.type = 'image' AND node.nid; SELECT node.nid FROM dpf_node AS node, dpf_image_galleries_images AS image WHERE image.image_nid = node.nid AND node.type = 'image' AND image.gallery_nid = 138; Both of these are work...

How does MySQL execute an aggregate query with a limit?

Does it group all possible results and then send back the results found within the given LIMIT? ...

need an sql query

I currently have two tables: 1. car(plate_number, brand, cid) 2. borrow(StartDate, endDate, brand, id) I want to write a query to get all available brand and count of available cars for each brand ...

Help writing a complex join query

Hello All, I am having a table orders orders ( id int unsigned not null, fcr_date TIMESTAMP, completion_date TIMESTAMP, factory_no varchar(255), vendor_no varchar(255)) Please ignore the data type typos if any. I want to write a sql query that helps me fetch the data per vendor factory. The data to fetch includes th...

Cumulative average number of records created for specific day of week or date range...

Yeah, so I'm filling out a requirements document for a new client project and they're asking for growth trends and performance expectations calculated from existing data within our database. The best source of data for something like this would be our logs table as we pretty much log every single transaction that occurs within our appli...

maximum enum usage in schema

i need to populate a table column which takes one of 30 different string values. Is it advisable to use enum here for speed up processing . Can anyone suggest better solution which is reasonably optimum for storage and processing(comparison)? ...

querying multiple servers

Hi everyone I am building a web service which needs to query 1 to n file servers, and receive multiple files as a result. Does anyone have a good idea on doing this? Would Threads do any good job? What if the connection with some servers takes longer than the others? How do I know if I really have ALL the queried files? Thanks ...

PostgreSQL: How to optimize my database for storing and querying a huge graph

I'm running PostgreSQL 8.3 on a 1.83 GHz Intel Core Duo Mac Mini with 1GB of RAM and Mac OS X 10.5.8. I have a stored a huge graph in my PostgreSQL database. It consists of 1.6 million nodes and 30 million edges. My database schema is like: CREATE TABLE nodes (id INTEGER PRIMARY KEY,title VARCHAR(256)); CREATE TABLE edges (id INTEGER,li...

mysqli query, LIKE and AND in the same query doesn't work out like it should

so this is my query, it doesn't matter if approved is set to 0 or 1 it will give me all the rows anyway SELECT * FROM `tutorials` WHERE tags LIKE '% php %' OR tags LIKE 'php %' OR tags LIKE '% php' OR tags = 'php' AND approved=1 I guess it's because of the OR but I might be wrong, if someone could help me out on this :) ...

Query driving a view and actual view not returning same results

I have a view that is returning four columns of data to be pushed to an external program. When I simply query the view ("Select * from schema.view_name") I get 10353 rows. When I run the actual SQL that created the view (I literally copied and pasted what Oracle had stored, minus the "Create or Replace" statement), I get 238745 rows. An...

Sql Shorthand For Dates

Is there a way to write a query equivalent to select * from log_table where dt >= 'nov-27-2009' and dt < 'nov-28-2009'; but where you could specify only 1 date and say you want the results for that entire day until the next one. I'm just making this up, but something of the form: select * from log_table where dt = 'nov-27-2009':+1;...

Prevent Access from Changing Queries

Hello, Microsoft Access wants to be helpful and change my queries when underlying object (either form or query) does not exist. For example, if I had a query that did the following... SELECT FirstName FROM persons If the persons table does not exist yet, and I import the query, Access will place an "expr: " in front of FirstName si...

failed to prepare insert statement

sqlite3 *insert_statement=nil; if (insert_statement == nil) { static char *query = "INSERT INTO iteminfo (itemname, friendid) VALUES(?,?) where itemid=?"; if (sqlite3_prepare_v2(database, query, -1, &insert_statement, NULL) != SQLITE_OK) { NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_e...

not preparing insert query

if (insert_statement == nil) { static char *query = "INSERT INTO iteminfo (itemname, friendid) VALUES(?,?) where itemid=?"; if (sqlite3_prepare_v2(database, query, -1, &insert_statement, NULL) != SQLITE_OK) { NSAssert1(0, @"Error: failed to prepare statement with message '%s'.", sqlite3_errmsg(database)); } i am new to Objective ...

How I can optimize this slow query?

I want to know how I can optimize it, preferably without changes in tables structure. SELECT p.author_id member_id, m.members_display_name member_name, COUNT(p.pid) posts FROM forum_topics t STRAIGHT_JOIN forum_posts p STRAIGHT_JOIN forum_members m WHERE p.author_id != 0 AND p.author_id = m.member_id ...

fastest way to query database in java

I have a MSSQL Database, and I have a stored procedure for any possible query, most of them just return a row of data with 3 columns or just execute an INSERT How in java to connect to the DB and execute a stored procedure, and retrieve some data ? ...

Tool for monitoring SQL query results needed

Hi, I am looking for a tool to monitor results of a periodically run sql query and raise a notification based on the fact that the query returns any results. (any other filters are welcome) I need to watch a transaction table for errors, and it would be great if my sql query could run in background, refresh itself periodically and show...