Forum: MySQL Sep 18th, 2009 |
| Replies: 3 Views: 443 Your query probably belongs more in Computer Science, but it fits here well enough. I was in a similar position a while ago, in that I had to take over maintaining a general ledger and time & billing... |
Forum: MySQL Jul 8th, 2009 |
| Replies: 3 Views: 991 It's telling you exactly where to look for the error. Hint: look at the first non-whitespace character before 'FROM'.
Give up? OK. You have a trailing comma in your AS clause. (You've no idea how... |
Forum: MySQL Jun 12th, 2009 |
| Replies: 8 Views: 616 There are several reasons I use the '... SET col=name ...' syntax:
When written with good spacing, the source code is much more readable and grokable.
I don't have to keep printouts of the... |
Forum: MySQL Jun 5th, 2009 |
| Replies: 4 Views: 667 Do you need to assign the result of the query to $result before you can use the result? |
Forum: MySQL May 11th, 2009 |
| Replies: 3 Views: 487 You're quite right; it doesn't work, and wasn't supposed to work verbatim. :)
The regular expression needs to be a pattern that matches your data, not the fictitious data in my fictitious table.... |
Forum: MySQL May 11th, 2009 |
| Replies: 3 Views: 487 You need a regular expression. Something like this will match rows that contain at least one capital letter in the remainder of the field:
select * from myTable where myField regexp 'CAPS.*[A-z]'; |
Forum: MySQL May 4th, 2009 |
| Replies: 1 Views: 617 In order to relate two tables of information, you need a value that ties them together, a value that is the same in each. If you give each company in the CompanyName table a unique ID, you then store... |
Forum: MySQL May 2nd, 2009 |
| Replies: 1 Views: 583 MySQL has a migration toolkit available; I think it is part of typical distributions. See http://dev.mysql.com/doc/migration-toolkit/en/index.html for the documentation. Try... |
Forum: MySQL Apr 30th, 2009 |
| Replies: 1 Views: 943 It would seem to be possible. Use the BACKUP command to make the dump. Use the RESTORE command to restore it.
And from Experts Xchange... |
Forum: MySQL Apr 11th, 2009 |
| Replies: 1 Views: 826 Of course there is. Don't be ridiculous. :) :)
#! /bin/sh
typeset -i i
typeset -i imax
i=0
imax=1000 |
Forum: MySQL Feb 10th, 2009 |
| Replies: 6 Views: 824 No, not showing the definition. Rather, showing the current date. For example, on my desktop computer:mysql> select curdate();
+------------+
| curdate() |
+------------+
| 2009-02-10 | ... |
Forum: MySQL Feb 9th, 2009 |
| Replies: 6 Views: 824 What does 'select curdate();' return? |
Forum: MySQL Jan 19th, 2009 |
| Replies: 3 Views: 535 Here's a bit of code that might do the trick, assuming the checkboxes are ANDed together: if they check all three, then they will see records that show open on Sunday, have video and have at least... |
Forum: MySQL Jan 11th, 2009 |
| Replies: 3 Views: 467 'index' is a reserved word. You must name that column something else. |
Forum: MySQL Jan 10th, 2009 |
| Replies: 4 Views: 695 Since the script times out, I assume you are attempting to do this via a web browser/server. If you don't have shell access to the server, you may be stuck doing it in chunks. However, there are... |
Forum: MySQL Jan 9th, 2009 |
| Replies: 1 Views: 1,062 Would this do the trick?
SELECT DISTINCT ip, * FROM links WHERE url contra = FALSE ORDER BY rand() LIMIT 0,5 |
Forum: MySQL Jan 9th, 2009 |
| Replies: 1 Views: 773 I don't know if there is anything built into MySQL to do this. It's been a while since I've had to 'track' autoincrement values, but that's where you can look. But you can get close using... |
Forum: MySQL Dec 25th, 2008 |
| Replies: 1 Views: 434 You're on your own for accessing the MySQL server.
The following statements usually work for creating databases and tables:
create database;
use;
create table a (field1, field2, ..., key);
... |
Forum: MySQL Dec 25th, 2008 |
| Replies: 1 Views: 673 This is pseudo-codeish so you have to RTFM and google to make it work. :) You need to use count() and group by. Something like this is kind-of close:
select count(id), id from table where... |