sql

iPhone SDK: Data Synchronization

I am looking for an overview of data synchronization techniques available on the iPhone platform. We need the ability to be able to sync a subset of content from a server to a local database residing on the iPhone. On other projects I have worked on, the data synchronization was handled by the database. Is that available in SQLite? If ...

How to merge existing row with new data in SQLite?

I have a database full of simple note data, with columns for title, due date, priority, and details. There is also a _id column PRIMARY KEY int. Say I have a note in the table already with some data filled and the rest null. I also have a set of data that will fill all those fields. Is there a way that I can only write data to the fi...

SQL Function for On Balance Volume (Financial Query)

I would like to create a function for On Balance Volume (SQL Function). This is too complex of a calculation for met to figure out but here is the outline of the User Defined Table Function. If someone could help me to fill in the blanks I would appreciate it. Craig CREATE FUNCTION [dbo].[GetStdDev3] (@TKR VARCHAR(10)) RETURNS @r...

How to SQL compare columns when one has accented chars?

I have two SQLite tables, that I would love to join them on a name column. This column contains accented characters, so I am wondering how can I compare them for join. I would like the accents dropped for the comparison to work. ...

Good embedded database solution (like SQLite) for .Net

I am looking for file based storage solutions that I can use with a .Net project. THey need to have a sql-like interface for storing and retrieving data. They need to have relatively little overhead and must not require any additional components installed by the end user. I am hopping for a .dll that I can reference and use. Cool poi...

Oracle SQL clause evaluation order

In Oracle, which clause types get evaluated first? If I had the following ( pretend .... represent valid expressions and relation names ), what would the order of evaluation be? SELECT ... FROM ..... WHERE ........ GROUP BY ........... HAVING ............. ORDER BY ................ I am under the impression that the SELECT ...

Getting rows which include a value with MySQL

I have a MySQL query which gets including some vars like that: messages TABLE receiver cols user1 rows : 1,3,5 user2 rows : 2,3 user3 rows : 1,4 I want to get rows which includes '3' value. So I will get 'user1' and 'user2'. I tried that but naturally it doesn't work. mysql_query("SELECT * FROM messages WHERE receiver='3'"); How...

SQL for total count and count within that where condition is true

Hello, I have a single user table and I'm trying to come up with a query that returns the total count of all users grouped by date along with the total count of users grouped by date who are of a specific client. Here is what I have thus far, where there's the total count of users grouped by date, but can't seem to figure out how to get...

Simple SELECT query problem...

Hi, I have this MySql select query which seems to have a bug but I am quite "green" so I simply cannot see, so maybe you could help? Here is the query: SELECT node_id FROM rate WHERE node_id='".$cat_node_id_string."' LIMIT ".$node_count_star.",".$node_count_end." ORDER BY SUM(amount) GROUP BY node_id Thanks for help in ...

Autoincrement based on a set of other columns

I have a table Course and every Course has many Resources. Course ========== course_id Resource ========== course_id number I want something like a separate autoincrement for each course_id. Or, in other words, I want to auto-enumerate the resources for a given course. For example, the resource table could look something like: cours...

SQL string replace with ID statement

Is it possible to create a sql statement to do the following: Table 1 lists all of the drug names, Table 2 contains all of the side effects. Table 3 contains all the drug names by ID and all of the side effects separated by |. Is there some kind of SQL query I can run to re-create Table 3 where the side effects separated by | are the ...

In sync query calls, one query causing other query to run slower. Why?

Sorry for the long question, but I think this is an interesting situation and I couldn't find any explanations for it: I was involved in optimization of an application that performed a large number of sequential SELECT and INSERT statements on a single dedicated SQL Server database. The process needs to INSERT a large number of records...

How to do this query?

Hello everybody! I have a mysql table with these columns: ID (auto-increment) ID_BOOK (int) PRICE (double) DATA (date) I know two ID_BOOK values, example, 1 and 2. QUERY: I have to extract all the PRICE (of the ID_BOOK=1 and ID_BOOK=2) where DATA is the same! Table example: 1 1 10.00 2010-05-16 2 1 11.00 2010-05-15 3 1 ...

Datagridview error

I have two datagridviews. So for the second one, i just copy-pasted the code from the first and changed where the difference was. But i get an error at the secod data grid when i want to view the result of my sql code. Translated in english the error show something like that there was no value given to at least one required parameter. Pl...

c# reading integer fields from database, returning empty string when reading integer type field

what is wrong with this code? field="id"; table="MInvMonth"; condition="machine_id=37"; public static String getConditionedField(String field, String table, String condition) try { if (cmd == null) getConnection(); cmd.CommandText = "Select " + field + " from " + table + " where " + condition; SQLiteData...

access: passing variables from vba to sql

i am clicking a button on a form in access: Private Sub Command29_Click() some_variable = 2 stDocName = "test" DoCmd.OpenQuery stDocName End Sub my query looks like this: SELECT * FROM [some_table] WHERE [Occurrence Number]=some_variable; is this possible to do? ...

distinction between using .text and .value in VBA access

i am passing the textbox1.text values into a query and sometimes into a string sometimes i say this: dim combor1 as string combor1 = comboReason1.Text how do i know when i should put combor1=comboreason1.value ?? also why do i need to set focus for a control to reference its property? that doesn't make sense to me also when i set ...

MySQL to fill in missing dates when using GROUP BY DATE(table.timestamp) without joining on temporary table

Hello, after reading through a couple similar Qs/As I haven't quite found the solution I'm looking for. The table data I have is GROUP BY DATE(timestamp) and returning a count, example result: [timestamp] => 2010-05-12 20:18:36 [count] => 10 [timestamp] => 2010-05-14 10:10:10 [count] => 8 Without using a temporary table, or calendar ...

Help in formulating sql query

Here is my scenario Table 1: GID || Info1 Table 2: GID || Tb1GID (refers to GID of Table1) || Info2 Table 3: GID || Info3 Table 4: GID || Tb2GID (refers to GID of Table2 || Tb3GID (refers to Table3 GID || Value Now I have to build an sql query to get the value, given a particular Info1, Info2, I...

How to build this encryption system that allows multiple users/objects.

Hello! I am trying to figure out how to create an optimal solution for my project. I made this simple picture in Photoshop to try to illustrate the problem and how i want it (if possible). Illustrative image Ill also try to explain it based on the picture. First off we have a couple of objects to the left, these objects all get encryp...