MySQL ver 5.1.26
I'm getting the wrong result with a select that has where, order by and limit clauses.
It's only a problem when the order by uses the id column.
I saw the MySQL manual for LIMIT Optimization
My guess from reading the manual is that there is some problem with the index on the primary key, id. But I don't know where I s...
I was just wondering how i would be able to code perform an SQL query and then place each row into a new array, for example, lets say a table looked like the following:
$people= mysql_query("SELECT * FROM friends")
Output:
| ID | Name | Age |
--1----tom----32
--2----dan----22
--3----pat----52
--4----nik----32
--5...
I have a timestamp in a mysql table with attribute "ON UPDATE CURRENT_TIMESTAMP". Is there a way to manually disable updating the timestamp on a special occasion? (eg: updating the entry to revise a blog post, but not to re-date it)
...
i write this query using t-sql and give me an error (Incorrect syntax near the keyword 'OR')
How to write it in correct way ?
SELECT SUM(Quantity)
FROM Invoices
WHERE Invoices.InvoiceDocStatusID =
CASE @InventoryType
WHEN 1
THEN ((2)OR(1))
ELSE 2
...
Hi,
Let's say I have a MySQL database with 3 tables:
table 1: Persons, with 1 column ID (int)
table 2: Newsletters, with 1 column ID (int)
table 3: Subscriptions, with columns Person_ID (int), Newsletter_ID (int), Subscribed (bool), Updated (Datetime)
Subscriptions.Person_ID points to a Person, and Subscription.Newsletter_ID points t...
i have a combobox on a form
i want the text of the combobox to be passed into a query.
my query is:
select..from..where something=[Forms]![Enter Data]![comboCup]
the form name is enter data and the combobox name is combocup. should i do:
[Forms]![Enter Data]![comboCup]![text]
or
[Forms]![Enter Data]![comboCup]![value]
??
...
Hi,
I have this Python script:
import sys
import getopt
import timeit
import random
import os
import re
import ibm_db
import time
from string import maketrans
runs=5
queries=50
file = open("results.txt", "a")
for r in range(5):
print "Run %s\n" % r
os.system("python reads.py -r1 -pquery1.sql -q50 -sespec")
file.write('END...
Is there a way to specify a join on all fields from table A with only one field from table B?
Is it necessary to specify each individual field from each table instead of using the all symbol (*) for one of the tables?
...
i need to know if any text has been entered into a combobox
if i do:
If comboReason1.Value <> "" Then
it gives me an error, and if i do:
If comboReason1.Value <> Null then
this doesn't work.
how do i check whether text has been entered into the combobox?
...
Which approach is better to use:
BoundField.NullDisplayText isn't set. NULL-case is foreseen in SQL query, i.e. SELECT ISNULL(amount, 0) FROM table
or
BoundField.NullDisplayText is set, e.g. "0.00 %". NULL-case isn't foreseen in SQL query, i.e. SELECT amount FROM table
What do you think?
...
I'm trying to optimize SQL queries in Akonadi and came across the following problem that is apparently not easy to solve with SQL, at least for me:
Assume the following table structure (should work in SQLite, PostgreSQL, MySQL):
CREATE TABLE a (
a_id INT PRIMARY KEY
);
INSERT INTO a (a_id) VALUES (1), (2), (3), (4);
CREATE TABLE b ...
I have a single MYSQL Question and need help ASAP.
Database:
-------------------------------------------------------------------
Email | Name | Tag
-------------------------------------------------------------------
[email protected] |Test Person | TagOne
[email protected] |Test...
I have a table in excel format (2007 but I can save as anything below that, naturally), and I have an SQL Compact Edition 3.5 SP1 Database table with corresponding columns. I simply want to populate the SQLCE table with the data from the excel file. The data consists of strings and integers only.
I tried this utility to no avail, I also...
Hi,
Can anyone help me with a SQL query in Apache Derby SQL to get a "simple" count.
Given a table ABC that looks like this...
id a b c
1 1 1 1
2 1 1 2
3 2 1 3
4 2 1 1
** 5 2 1 2 **
** 6 2 2 1 **
7 3 1 2
8 3 1 3
9 3 1 1
How can I w...
I have a table with three columns:
patient_id
obs_date
weight_val
patient_id stores patient identification #, weight_val stores a weight value, and obs_date stores the date when the weight reading was taken. So, a patient can have many different weight readings at different dates.
How do you write a query for:
select all patient...
Is these a way i can loop through a PHP array and have the data outputted into a JavaScript array?
For example, the JS script below will not work
var mon_Loop = <?php echo $rowCount_Mon ?>;
var mon_Events = new Array();
for(i = 0; i < mon_Loop; i++)
{
mon_Events[i] = <?php $divMon[i] ?>
}
I Know its because the "i" is not a php...
I'm trying to create a IT asset database with a web front end.
I've gathered some data from forms using POST as well as one variable that had already written to a cookie.
This is the first time I have tried to enter the data into the database.
Here is the code:
<?php
//get data
$id = $_POST['id'];
$company = $_POST['company'];
$loca...
i would like the user to think he's using a regular winform, but in the backend i want to have access handle the DB stuff.
is it possible to just use the access form and have everything else disappear in the background? can we make an exe out of the form?
what is MDE?
...
I am working on an Asset DB using a lamp stack.
In this example consider the following 5 tables:
asset,
server,
laptop,
desktop,
software
All tables have a primary key of id, which is a unique asset id.
Every object has all asset attributes and then depending on type of asset has additional attributes in the corresponding table. If ...
I need to check if a row exists in a database; however, I am trying to find the way to do this that offers the best performance. This is best summarised with an example.
Let's assume I have the following table:
dbo.Person(
FirstName varchar(50),
LastName varchar(50),
Company varchar(50)
)
Assume this table has millions of rows, howev...