query

Is there a way to query a VB Script Array?

I'd like to be able to query an array (multi and single dimensional ) with something like SQL. Is there a way to do this? It just seems extraordinarily wasteful to step through it one record at a time. ...

Database optimization: Hashing all the values

Hi, Typically, the databases are designed as below to allow multiple types for an entity. Entity Name Type Additional info Entity name can be something like account number and type could be like savings,current etc in a bank database for example. Mostly, type will be some kind of string. There could be additional information associat...

SQL WHERE clause for column all capitalized

table_beatles contains the following data in column name. John PAUL george RINGO In MS-SQL is there anyway to get any item which is all caps? eg SELECT * FROM table_beatles where name is (AllCaps SYNTAX HERE) to return PAUL and RINGO. ...

MySQL subquery required help

i am a beginner of MYSQL please help me. i have a two table images and rate. i want out put is imgID Rate. image id as p.k in images table. image is is foriegn key in rate table. rate table sample data is ImgID Rating 1 5 1 7 1 8 2 8 3 2 4 3 1 4 image table sample data is ImgID Commen...

How to use wildchards, fuzzy search with Solr?

I use Solr for searching in my data and I recognized now that some of the solr search query language feature does not word for me. I miss these from the capabilities I have: fuzzy search wildchards * ? - I do not have stemming set up so far, this would be useful temporarily for searching field specification - currently I cannot tell se...

Filtering Search Results with Wordpress

Hi, I'm trying to setup a Search Results page with two columns. First column will present results from all categories except one (Galleries), and the Second column will present only the Galleries category. query_posts() simply resets my results. This is what I got so far. Broken: <?php $s = get_query_var('s'); ...

Multiple Groupings within a Content Query Web Part

Does anyone know of a way to do multiple groupings on a content query web part. I have been able to customeize everything else, but the sub groupings issue has me. What I need to do is, first group the list by column1, then within that grouping group on column2. Any help would be great. Thanks ...

How do I echo selected in a while loop?

Hello, I have a blogs and questions section on my site that has categories. When a user composes a question or a blog, there is a drop down menu that allows you to choose your category. When you edit either of these you have the option of changing your category via the dropdown. When you go to edit a blog,the category drop down is a stan...

SQL result to PHP multidimensional array

Hi, I'm retrieving some hierarchical data from an Oracle database using the "connect by" function. Then I populate a PHP array with the result of my query looking like: while ($row_branches = oci_fetch_array($query_tree)) { $tree[] = array( 'id' => $row_branches['ID'] , 'parent' => $row_branche['PARENT'] , 'data' => htm...

What's wrong with this query?

Someone help me: $query = "INSERT INTO tbl_users(user, password, password_def, userid, level , regdate, lastdate, email) VALUES('$username', sha1('$password') , sha1('$password'), '$userid', '0', NOW(), NOW(), '$email');"; $userid is a ramdon md5 id. It gives me this error: posttokenError: Account not created ...

Order items in MongoDB according to the size of an array with MongoMapper?

I'd like to select a collection of items ordered based on the number of items within an array. Hopefully the following example will clarify my rather poor explanation: class Thing include MongoMapper::Document key :name, String key :tags, Array end I'd like to retrieve all Things ordered from those with the most tags to those w...

Combine Multiple Query Results in MySQL (by column)

I have 4 different queries and each of them return individual unique set of Results. I need to combine the Query Results with using a single query. my sample queries are: 1. select cls.* from (calls as cls inner join calls_users as clsusr on cls.id=clsusr.call_id) inner join users as usr on usr.id=cls.assigned_user_id where cls.assigne...

problem with convert text to time in sql server 2008 ?

hi i have this Ttime as nvarchar(10): "09:52:48" and i have TmpTime as date and i try to convert like this: "UPDATE MEN SET TmpTime = CONVERT(DATETIME, Ttime ,108 )" and i get in TmpTime this: "1900-01-01" why ? thank's in advance ...

Need help with MySQL query for Wordpress

My problem is not with Wordpress's WPDB class, but with the MySQL syntax. I'm trying make the following sequence work: Get an array of all Posts IDs Filter out posts from a specific Category Filter out duplicates, revisions, drafts etc. Only show Published content. Help? Thank you. ...

Dropping a column from a "$result" resource after a db query

After a simple query that is successful, $sql = "SELECT * FROM mytable" ; $result = mysql_query ( $sql ) ; is there a way to "drop" a specified column from the $result resource? IOW, the $result consisted previously of 8 fields, but afterwards contains of only 7. Thanks. ...

time query for vb6 and msaccess

Query for VB6 and MS Access Table:- User Id LogDate LogTime 1 1/1/2010 9:00 1 1/1/2010 10:00 1 1/1/2010 11:29 1 2/1/2010 10:00 2 2/1/2010 22:00 2 ...

MySQL Embedded SELECTs vs. JOINs

Is there a noticeable difference between: SELECT userid, username, userdept, (SELECT deptname FROM depts WHERE deptid=userdept) AS deptname FROM users and SELECT userid, username FROM users INNER JOIN depts ON depts.deptid=users.userdept Which one is better? ...

How to cast MySQL result to a string?

There is a query: SELECT blalist FROM blatable WHERE blafield=714 which returns a string that looks like: "2,12,29,714,543,1719". And there is another query: SELECT userid, name, surname, creditcardnum, items FROM stolencards WHERE userid IN (SELECT blalist FROM blatable WHERE blafield=714) Now that's not working. I only ma...

Getdate() equivalent for Jet / Access database. Need last month records.

Hello, I was reading other questions posted and found many examples to retrieve last month records. I am using Visual Studio 2008 query builder to retrieve records from an Access mdb and when I enter the following query it is displaying me an error that getdate is not a valid function: where [Transaction Date] between dateadd(...

Aggregate and Query the RSS feeds, simply quickly and save the queries

Ok I know about YQL, Yahoo Pipes and all that. But I am wondering what is the "shortcut" for someone who knows jQuery and javascript and JSON pretty well ? What would be the architecture of the generic solution using these tools to aggregate several rss feeds, and then query the result ? I would like to be able to save these queries an...