I have three tables like this (simplified version):
Object
---------------
ID | ObjectName
---------------
Category
-----------------
ID | CategoryCode
-----------------
ObjectCategory
---------------------
ObjectID | CategoryID
---------------------
How can I select ObjectName and CategoryCode for all objects who don't belong to ce...
Is this set somehow in a variable?
Is it possible to store decimal values in INT fields or does it have to be FLOAT?
Comma or point as a separator? Or does it even matter?
Thanks
...
Say the users table in my MySQL DB contains a very large number of entries.
I need to go through all the users, but I want to do it only chunks at a time (i.e. using LIMIT and OFFSET):
SELECT * FROM users LIMIT 100 OFFSET 200
Is it possible to know the total number of users matched in the query, but only return a LIMIT number of them ...
Data:
values date
14 1.1.2010
20 1.1.2010
10 2.1.2010
7 4.1.2010
...
sample query about january 2010 should get 31 rows. One for every day. And values vould be added. Right now I could do this with 31 queries but I would like this to work with one. Is it possible?
results:
1. 34
2. 10
3. 0
4. 7
...
...
Hello.
I am new to sql so my terminologies might not be very correct.
I have a table Alignment which has got 250 million records. It has two columns chain_id1 and chain_id2. Some of these chains are foreign keys for chain_id from another table Centroid which has 22000 records.
Basically I need all those records which are have both cha...
I installed jython, django on my windows system. I successfully created a project mysite. Now after updating settings in settings.py. i ran 'manage.py' and got the error- Import error - "no module named mysqldb".
now, i downloaded mysqldb (which is for python, but i thought it will work for jython also) and i tried to install it. but now...
I'm trying to put an image as a separator between menu items but not on the outside and I'm not sure how to do this.. So it would end up being something like this:
HOME | ABOUT | CONTACT
unfortunately my code puts one after every entry including the last one.
mysql_select_db($database_db_connection, $db_connection);
$query_rsMenu = "S...
I am currently working on a light php framework to use with some high request ajax for my site, and have run into an interesting problem that has me completely stumped. The ajax is for a series of notifications, so the javascript sends off an ajax request for new information every 30 seconds. This ajax is active on every page of the enti...
A client of mine in Florida has a site hosted on a server in Houston, TX. He is upset that all of his reports are coming out from the database a hour off. to insert records into the database, the MySQL Function time() is used, then a standard SELECT statements get the records out of the database. Is there some easy way I can modify the...
UPDATE `table`
SET `sent`='1', `taken`='1', `free`=NULL
WHERE `owner`='1' AND ISNULL(`sent`) AND !ISNULL(`free`);
Works, but set free to NULL not always works.
Any ideas? Thx
...
I have the following query (which should return a scalar/numeric), But I still get a sql error.
I am using mysql 5.0.77 or 5.1.37
SELECT CAST(SELECT COUNT(*) FROM t1 AS VARCHAR)
...
We are looking to create an in-house Project Dashboard application. Project Managers will use this to create and update projects, submit project status, enter project metrics, etc. A separate reporting piece would read the data entered by the tool and bubble up reporting data.
If this were 1990 and the app was to run in DOS I would ch...
I am trying to number some rows on a bridge table with a single UPDATE/SELECT statement using a counter variable @row. For example:
UPDATE teamrank JOIN (SELECT @row := @row + 1 AS position, name FROM members)
USING(teamID, memberID) SET rank = position
Is something like this possible or do I need to create a cursor? If it hel...
I am currently selling time based access passes to an online service at micro payment prices.
After payment the customer gets a set of credentials that is only valid for the purchased period. When the access pass expires the customer has to buy a new set of credentials.
So basically the credentials are one-time(period) use only.
I wo...
I use LOAD DATA LOCAL INFILE to upload csv files to MySQL.
If the csv was created by a mac, I include LINES TERMINATED BY '\r' in the query.
If the csv was created by a MS Office, I include LINES TERMINATED BY '\n' in the query.
If the csv was created in Open Office, I omit LINES TERMINATED BY altogether.
Is there a way I can formula...
Terminating a MySQL query with \G instead of ; will cause MySQL to return the result set in vertical format, which is sometimes easier to read if the number of returned columns is large.
Example:
mysql> SELECT * FROM help_keyword LIMIT 3\G
*************************** 1. row ***************************
help_keyword_id: 0
name...
I need to remove any instances of 544 full-text stopwords from a user-entered search string, then format it to run a partial match full-text search in boolean mode.
input: "new york city", output: "+york* +city*" ("new" is a stopword).
I have an ugly solution that works: explode the search string into an array of words, look up each w...
I have a table comparisons. If I run
SELECT comparisonID,stu1Vers,stu2Vers,stu1,stu2
from comparisons
WHERE stu1!=stu2 and assignmentid=9;
I get something like:
+--------------+----------+----------+------+------+
| comparisonID | stu1Vers | stu2Vers | stu1 | stu2 |
+--------------+----------+----------+------+------+
| ...
Hi,
I am working on an assignment where I am supposed to find all of the tables in information_schema of a "blank" database. I can do this in either MySQL or PostgreSQL. I chose MySQL. So, I have identified all of the tables:
CHARACTER_SETS
COLLATIONS
COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS
COLUMN_PRIVILEGES
INDEX_STATISTICS
KEY...
The MySQL query:
SELECT title,alias,parent FROM '._prefix.'categories
WHERE (language = \''._language.'\' || language = \'all\')
&& status = \'published\'
ORDER BY rank ASC
The Result (from phpMyAdmin):
title | alias | parent
Home | home | 0
Todo | todo | 0
Multiuser| todo_mu | 21
Modulsys | todo_mo...