query

Tool for Querying data at Runtime with LINQ

The more and more I use the LINQ the more and more I really enjoy it, and it's syntax. I do a lot of data comparisons on a day to day basis. What I would really enjoy is a tool that allows me to load a DataSet, and then query that DataSet at runtime with LINQ queries. I primarily just want a tool, and to be able to load my DataSets dynam...

Oracle Query Monitor

Hi, i want know querys of third party software executed in my oracle server, anybody know how i can do that?i will use one time, can be trial software or script anything..thx ...

What to use instead of LIMIT x, y if BETWEEN is not capable? Pagination.

I have 10k forum topics. I run this query: SELECT * FROM `topics` WHERE category_id = '2' ORDER BY `last_message` DESC LIMIT 2990, 10 This checks all rows! All rows! Even after adding index to last_message. last_message is a time() and I want to order all messages by that descending. So, what do you suggest me? Without...

Facebook API get events CREATED BY friends

Hi! I am developing facebook app which needs to retrieve events created by some of my friends. Standard SQL query would look like this: NSString *fql1 = @"SELECT " @"eid, name, tagline, id, pic_small,host, description, start_time, creator " @"FROM " @"event " @"WHERE " @"creator = 1111111111 OR creator = 2222222222 OR creator = 33...

AndAlso in VB Linq query, doesn't seem to be working.

The below query fails with Null Reference Exception when there are elements in BOMIDs where MatID property is nothing. I thought the 'x.MatID isnot Nothing AndAlso' would prevent the x.MatID.Process part of the where from being executed. There are a couple elements in the BOMIDs collection that where MatID is nothing. Any thoughts? Fro...

leading zeros in mysql zerofill int field not showing when queried

I have a table with auto increment zerofill ID numbers. When I query the data the IDs lose their leading zeros (i.e. "000529" returns as "529"). Is there a way to preserve the leading zeros, or even generate them back in the query statement? I know I can generate them back in PHP using STRPAD, but for the specific project I am on I would...

Improving query performance by using views

I have a large table with 10+ millions records in a SQL Server database. The table contains certain type of data for all 50 states in the US. So if I create 50 views, one for each state, from this table, would the performance of making queries from my application be improved? Other suggestions? ...

Is there a way to define NamedQueries outside of entity?

I use Netbeans as IDE and use the wizards to generate Entities. If I want to define custom NamedQueries (not the ones auto generated) how can I define those outside of the entity so I don't lose them if I have to recreate the entity using the wizard? ...

Mysql Query Optimization (Group_Concat)

SELECT b.isbn, booktitle, price, description, GROUP_CONCAT(c.contributorid SEPARATOR '|' ) AS contributorids, GROUP_CONCAT(fname, ' ', lname SEPARATOR '|' ) AS contributornames FROM (book AS b LEFT JOIN book_contributor AS bc ON b.isbn = bc.isbn) LEFT JOIN contributor AS c...

How do you create a simple function to query the database? Mine isn't working!

I want to make a simple function that I can call on to query my database. I pass the "where" part of the query to it and in the code below, my $q variable is correct. However, what should I then do to be able to use the data? I'm so confused at how to do something I'm sure is extremely easy. Any help is greatly appreciated! function get...

How to get intro record from each group

I have a following table id group name 1 2 dodo 2 1 sdf 3 2 sd 4 3 dfs 5 3 fda .... and i want to get intro record from each group like following id group name ... 1 sdf 2 dodo 3 dfs ... ...

help with query - update from 2 tables

hi i have 2 tables table1: num,X,Y table2: num,X,Y i need to update X and Y in table1 where table1.num = table2.num how to do it ? i need it in Oracle query (i think that in sql server it will work too) thank's in advance ...

What's the best field type and data usage to accelerate searches?

I have a question about equivalent search result, that can occur on different fields. Let's say I record the logical deletion state of records with 3 fields like : Boolean Deleted Date DeleteDate String DeleteUserName The goal of the query is to avoid having deleted records into my selection. So I can search the first field with on...

SQL transform table query

Hi, I got a problem transforming a table that looks like this PropertyName | PropertyValue --------------------------------- color red color blue size big size small into this: Color | Size --------------------------------- red big red small blue big blue small How can I achieve this? Thanks in advance for any ...

Mysql SHOW COLUMNS FROM Query????

show columns from (select * from (select * from my_table) as T) ????? I get a Syntax error... ...

improve sql query performance

Hello, I have the following tables: Products Categories Subcategories Brands with the following fields: Products: id name description1 description2 description3 id_category id_subcategory id_brand Categories: id name Subcategories id name Brands id name What I want is to make a query, where the user inputs 1 or more...

TSQL Set theory

Here is the question You are to label the dice sides with numbers. Each dice has 6 sides. You have two dice. You must label so that you can display (not sum or product) the numbers 0 to 31. Complete output: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 I tried (select 0 as ...

MySQL JOIN help

Hello, I hate asking for code but I just can't seem to do the below - Staff | lastname - name - position | | Henderson | John | A | | Howard | Bob | B | | Hendry | Chris | B | Max_person | lastname - change | | Henderson | John | | Howard | Bob | | Hendry ...

Rails query with attributes on two tables

How do I write a find(:all) query in rails (v2.3.5) that has parameters both in the model I am running the 'find' on, and in another table? e.g. I am trying to search for 'posts' by 'author' and 'tag'. Author is an attribute of post, whereas tag is associated with it through another table. I can get the tags by including ':joins =...

MySQL JOIN table query help

Hello, I hate asking for code but I just can't seem to do the below - Staff | lastname - name - position | | Henderson | John | A | | Howard | Bob | B | | Hendry | Chris | B | Max_person | lastname - change | | Henderson | 0.9 | | Howard | 0.2 | | Hendry ...