query

MySQL Sum one field based on a second 'common' field

Not a SQL guy, so i'm in a bind, so I'll keep this simple +--------------+------------------------+ | RepaymentDay | MonthlyRepaymentAmount | +--------------+------------------------+ | 3 | 0.214847 | | 26 | 0.219357 | | 24 | 0.224337 | | 5 | ...

How to query for an interface and filter the resultset with JDOQL?

Hi, I have an interface @PersistenceCapable public interface MyInterface { public abstract String getName(); public abstract void setName(String name); } The persistence layer uses JDO. The JDO implementation is DataNucleus. Now I want to query for any instances of that interface with JDOQL. Query query = getPersistence...

MySQL: Limit a query to 10 rows where every index has 5 tags.

Hi, I'd like to make a query where I can retrieve an interval of 10 rows with 5 tags per each one. I have houses and tags table, I know how to do it only for simple queries with a SELECT using LIMIT but how can I do it in this case? table houses id house country 1 Grunt Mansion us 2 Hororo Suneku jp 3 Ca...

MySQL mass UPDATE 40K rows with server resource friendly query

Hi, i have something like 40K rows and i must run update query like this: UPDATE table1 SET column1='very long value 1...', column2='normal lenght value 1a' WHERE pid ='123' column3='ccc'; column1 is TEXT column2 is Varchar(150) ...and i want to use mysql query what is more server resource friendly. I want to use something lik...

help with access date query

I need help with date queries in MS Access 2007. How do I show all data between date:01/06/2010 time:10:51 and date:13/07/2010 time:22:30? ...

FIRST ORDER BY ... THEN GROUP BY ...

I have two tables, one stores the users, the other stores the users' email addresses. table users: (userId, username, etc) table userEmail: (emailId, userId, email) I would like to do a query that allows me to fetch the latest email address along with the user record. I'm basically looking for a query that says FIRST ORDER BY userEm...

SQL query a new thread in vBulletin

Hello. How to make a query to the database(mysql) to create a thread? I need to create a thread from a non-registered user, if not, then from the present .. Simply query the database with the subject "Test", the text "test text" and any nickname Sorry for bad english, thank you! ...

Rotate table data with out update data

SELECT * FROM `your_table` LIMIT 0, 10 ->This will display the first 1,2,3,4,5,6,7,8,9,10 SELECT * FROM `your_table` LIMIT 5, 5 ->This will show records 6, 7, 8, 9, 10 I want to Show data 2,3,4,5,6,7,8,9,10,1 and next day 3,4,5,6,7,8,9,10,1,2 day after next day 4,5,6,7,8,9,10,1,2,3 IS IT POSSIBLE with out updating any data o...

Find Parent Recursively using Query

Hello, I am using postgresql. I have the table as like below parent_id child_id ---------------------- 101 102 103 104 104 105 105 106 I want to write a sql query which will give the final parent of input. i.e suppose i pass 106 as input then , its output will be 103. (106 --> 105 --> 104 --> 103) ...

Force Hibernate query to access database

I have loaded an entity into my transaction and have changed a property of that entity. The transaction is not yet commited. Now I would like to get the original value of the changed property. I've tried with a HQL query like select p.property from Person p where p.id = 1 with the ID of the entity loaded in the transaction. I've set q...

Is it possible to do a linq query on a GridView (ASP.NET)?

Basically I have a datakey that I'd like to query from my GridView instead of looping through all the rows and comparing the key of each row. So I was wondering if it was possible to just do a linq query on the gridview (not datatable) and filter with the datakey. ...

A Query in Ms-access

Hi, This query displays partnumbers which have eventtype is not equal to "PNremoved FROM Wrapper". This query is displaying the right data. Part number may be removed from this tracking number, but it can be entered using another tracking number. In that case it is not working. I want the query that works when we enter the same part n...

Speed Up XML Queries in SQL Server 2005

I store all my data in on XML column in SQL Server 2005. As more and more records are being inserted, I notice the queries are slowing down. I've tried creaeting a Primary XML Index, as well as a Secondary VALUE index and this did not do anything to help the speed. Any tips,thoughts, or tricks that I'm missing? Sample View that I que...

help using django's ORM for UNION query

Hi people, i am making a history page for a website. The structure of my classes is something like this: class Person(models.Model): name = models.CharField(max_length=100) type = models.CharField(max_length=30) class History(models.Model): date = models.DateField(max_length=100) action = models.CharField(max_length=...

SQL Server Compare similar tables with query

Simple concept we are basically doing some auditing, comparing what came in, and what actually happened during processing. I am looking for a better way to execute a query that can do side by side table comparisons with columns that are slightly differnt in name and potentialy type. DB Layout: Table (* is the join condition) Log (Un-a...

NHibernate: Querying with OR operator

I am looking for a way to build an OR operator into a query to look for a particular value in one field of a table as well as in another field of a joined table. This is pretty basic in SQL, but I can't for the world figure out how to do this in NHibernate. I have been searching the web, but the examples I find are pretty nebulous to me ...

Access Query Stops working

I have this Access database that we use to run reports. The report is ran twice a day every working day. For some reason the report will run fine usually in the morning but every now and then it will stop working. I go to debug and it will show a different query failed to run every time. So far there are two ways to fix this. Close the a...

Insert new relation 'B' for all data where relation 'A' does not exist?

Ok 3 tables, Users, Groups, and UserGroups. The important columns are Users.UserID, Groups.GroupID, UserGroups.UserID, and UserGroups.GroupID. I have a group we'll call group 'A', there are a bunch of Users in this group because there are many rows of UserGroups where the GroupID is the GroupID of group 'A'. Now for all the users who ...

Multi tables with same schema, query design strategy?

I have an Oracle database with a dodgy design: many tables have same schema. They're pieces from a huge table, and time by time, new tables will be created with specific rows. Of course, I'm not authorized to access the huge table, only the small ones. How can I query against these tables, effectively? Many thanks in advance. ...

Zend form file upload problem with jquery ajax form plugin

with latest zend framework i can't upload file with ajax. in my form there are 3 field (title, description , image) . I'm using zend form. For ajax submit i'm using jquery form plugin (http://jquery.malsup.com/form/) And here is the code for ajax submit. <script type="text/javascript"> // wait for the DOM to be loaded ...