Re: Returning where COUNT > 5

2004-06-21 Thread Daniel Clark
With a join and group by I think you have HAVING. >>Hi all >> >>how to do this in MySQL? Returning only records with COUNT > 5? >> >>SELECT >> `groups`.`groupsDescr`, >> `roles`.`roles_Agroup`, >> `roles`.`rolesDescr`, >> COUNT(`roles`.`rolesDescr`) AS TOTAL >>FROM >> `roles` >> INNER JOIN

Re: Erro on Query

2004-06-17 Thread Daniel Clark
Try back ticks around it. `DESC' > Dear Friends. > > when Creating the follow table > > CREATE TABLE CONHEC_DBF (CON CHAR (7) , >SER CHAR (2) , >NUMNF CHAR (8) , >SERNF CHAR (2) , >LOJA CHAR (2) , >PAIDF CHAR (12) , >QUANT REAL (6,0) , >NOP CHAR (10) , >TRAN CH

Re: Update problem

2004-06-17 Thread Daniel Clark
echo $updatequery to screen and see what the sql looks like. > I am trying to update a table from results generated from a select query, > but can't seem to get the queries running right. The select query works > fine, but when I try to use the results for an update it error out. Here > is > my

Re: MySQL Installation Problem

2004-06-17 Thread Daniel Clark
After the phpmyadmin login I got the same error. In the phpmyadmin config files I had to set the local IP address that phpmyadmin was on. > Dear Michael, > > I want to use PHP, Apache, mySQL and phpMyAdmin for evaluation but I m not > able to get this rite. > > > I am trying to instal MySQL with

Re: Learning PHP/MySQL

2004-06-16 Thread Daniel Clark
I like the web site www.phpbuilder.com ... lots of great articles. > Hi All, > > Can someone recommend a good book for learning PHP/MySQL? > > TIA, > Kay -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: MySQL vs Oracle

2004-06-16 Thread Daniel Clark
10 seconds !?Unless that query is huge and without indexes, it should run MUCH quicker. > I'm using Oracle 8.0.5 and MySQL 4.1.1a > > I'm not optimizing Oracle nor MySQL, because I don't want future users > messing with optimizations. > I access through JDBC drivers. Oracle usually needs 10 se

Re: Notifying User when DB is Updated via browser

2004-06-14 Thread Daniel Clark
How about an HTML meta tag refresh set at 20 minutes. >>This may be slightly off-topic, apologies if so but I was wondering if >>anyone could point me in the right direction. >> >>I'm currently storing applications from a web site into our mysql DB, our >>client has a web-based backoffice. He has

Re: Asterisks in Integer Columns

2004-06-06 Thread Daniel Clark
One simple option would be to add a footnote column. And add in your code, if footnote column is NOT NULL then add a * on to population and show footnote at the bottom. population footnote 100 null 200*yada yada >>Suppose I have several columns of numberals - are

Re: Where do exported SQL files go?

2004-06-02 Thread Daniel Clark
Using phpmyadmin, when I select Export, and click the checkbox "Save as File", it prompts where for where and what file name. >>I'm trying to figure out how to get my MySQL databases >>online. Someone told me to EXPORT my databases as SQL >>files, then go into my online websites's phpMyAdmin >>p

Re: RV: Select data from two different databases

2004-06-02 Thread Daniel Clark
Yes Local. SELECT databasename.tablename.columnname > Hi, two questions: > Is it possible to select data from different Databases on the same > server? > Is it possible to select data from different Databases on Different > servers across the network? > > I searched for information on how to do

Re: Completely Stumped - phpMyAdmin config

2004-06-02 Thread Daniel Clark
I remember something setting mine up. The phpMyAdmin.ini (I think) had to have the correct IP address of the machine/database it was running on. My machines internal address was 192.168.2.100, but the INI setting had to be the outside resolved IP 24.16.xx.xx if running it from outside. > Hello:

Re: Optimizing Queries (specifically with LIMIT)

2004-05-30 Thread Daniel Clark
I found it interesting. Thanks Eric. >>(reconstructed from archives i accidentally deleted the copy in my mailbox >>>Daniel Clark writes: >>>I don't see how LIMIT would make a difference. LAST_INSERT_ID() only >>>returns one record. >>>Bu

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Daniel Clark
I don't see how LIMIT would make a difference. LAST_INSERT_ID() only returns one record. But it's worth trying in a big loop to get timing numbers. >>I have a rather simple straightforward question that I was not able to find >>in any of the documentation. >>I am in the process of writing an

Re: WHERE pk1 AND pk2 returns 0 records

2004-05-17 Thread Daniel Clark
Possibly two rows? Can you change the where clause? WHERE CartID=999 OR ProdID=333 > I have a simple query: > SELECT * FROM cart > WHERE CartID=999 AND ProdID=333 > > The primary key is made of both CartID and ProdID, both integers. > > The query will not return the record in question > > This r

Re: Problem with a Select Query

2004-05-06 Thread Daniel Clark
SELECT user_id, rep_nurse_1, rep_nurse_2 FROM Users WHERE User_ID = 'x' > I have a problem with a SELECT query. I have a users table and each user > can > be a Rep, Nurse or Administrator defined by User_Type. Each Rep has two > Nurses allocated to them and the User_ID of the nurse is held in col

Re: Title Case Problem

2004-05-06 Thread Daniel Clark
I see in MaxDB there is initcap() function. http://dev.mysql.com/doc/maxdb/en/71/81738fb9b311d2a97100a0c9449261/content.htm > I have a table with upper case text. I want to use a function in my > select > statement the puts this text in title case so "MORE FOO YOU WIBBLE" > becomes > "More Foo Y

Re: AVG function in order by clause

2004-05-05 Thread Daniel Clark
In Oracle you can reference the second field AVG() by the field #. ORDER BY 2 > Thanks a lot for the replies. I have changed the query as follows: > > ** > SELECT > DB_ESTABLISHMENT_NAME, > AVG(DB_GRADE) > > FROM > ESTABLISHMENTS ES LEFT OUTER JOIN GRADES

Re: Use of AVG in where clause

2004-05-05 Thread Daniel Clark
I believe you have to add your AVG() to your GROUP BY clause. > I have a sql query as follows: > > ** > SELECT > DB_ESTABLISHMENT_NAME, > AVG(DB_GRADE) > > FROM > ESTABLISHMENTS ES LEFT OUTER JOIN GRADES GR ON > ES.DB_ESTABLISHMENT_ID=GR.DB_ESTABLISHMENT_I

Re: Range query on datetime with index - any optimization?

2004-05-05 Thread Daniel Clark
I wonder if mysql isn't trying to process where GMTBase > DATE_SUB(CURRENT_DATE, INTERVAL 2 DAY) What about doing this date subtracting in PHP and adding the result to the SQL statement. > Hello folks, > > I'm usinng MySQL 4.0.17. > > I have a table something like: > > RuleID int, > GMTBase da

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
Hum. I've never tried inserting without the field names. > Serves me right to type this stuff instead of copying/pasting - my > previous post was indeed wrong but also wasn't the exact code I used > (yours was, with the single quote embedded in the doubles). > > It's been a very dyslexic week for

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
How about: (I reversed on set of quotes) sqlstr = "INSERT INTO Jobs VALUES('" & txtSceneFile & "')" > Err...what I meant to say here was "ascii code equivalent (chr(39)" (I > tried single *and* double quotes). Sorry about that. > > Steve Pugh wrote: > >> Hi Daniel, >> >> I tried that to no avai

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
le & "')" > > but it generated the same erroneous string. Using the ascii-code > equivalent (Chr(34) does the same. > > It's just soodd!! > > Daniel Clark wrote: > >>I think you want chr(39) (single quote). -- MySQL General Mailing List F

Re: "INSERT INTO" dropping slashes from strings

2004-05-04 Thread Daniel Clark
I think you want chr(39) (single quote). > Every time I think I've got it, I am reminded thatI don't got it. > > Hello all, once again! Can anyone tell me why the following takes > place? In my VB app I am adding records to the table "Jobs" with this > code (trimmed way down - my actual INS

Re: Need correct 'order by' syntax where field does not contain "NULL"

2004-05-03 Thread Daniel Clark
select * from navigation WHERE id = '".$category."' AND active='y' AND order IS NOT null ORDER BY order, title > Hi. I had a MySQL DB set up and recently added a field 'order' to allow > for > exceptions in a web site menu heirarchy. Fields should be ordered by > 'order' > field first where it do

Re: urban myth?

2004-05-03 Thread Daniel Clark
Yes it is a myth. The records will come back in the same order IF there have been not inserts and deletes. Depends on the database product to. > My boss says that if you do a select statement against a table the > result set always comes back in the same order. I say that this is a > myth and t

Re: Database structure

2004-04-30 Thread Daniel Clark
I used to program for a medical tester. I used method 2: 2 - a table with 60 rows for one assessment : results(#assessment_nr, labtest_nr, p, d) where p and d are my two results. The BIG advantage was changes to the tests, adding new ones, or deleting fields. Made it much more flexible.

Re: Order by price?

2004-04-29 Thread Daniel Clark
I think when adding the $ the number gets convert to a string. And then the query orders it by alpha numberic. > I'm having trouble with this query: > SELECT > CONCAT('$',ROUND(($varA*(establishments^2)+$varB*(establishments)+$varC),2)) > as price FROM table ORDER BY price > > A note first. The c

Re: Last Record Pulling my hair out :D

2004-04-22 Thread Daniel Clark
Think you want: Select max(job_id) from job_log_2004 > I'm trying to select the last record (row) in a db. I'm trying with a > select: > Select * from job_log_2004 where job_log_2004.JobID = (select > max(job_log_2004.JobID) from job_log_2004) and it fails. The part about > select max works an

Re: Randomly selecting from table

2004-04-20 Thread Daniel Clark
Guess you could use the rand() function and look for a matching row id!?! > Is it possible to randomly select from all entries in a table, but have it > be 2 different ones each time? If so, what documentation should I be > looking > at? > > I am using PHP and MySQL together, if this helps. > > Th

RE: Error ?

2004-04-15 Thread Daniel Clark
Sounds to me like it doesn't the the alias name T2 but might need the full table name. > Hi, > > Can anyone give me a hint to what this error message is trying to say. > > Thanks, > > Justin Palmer > > > -Original Message- > From: Justin Palmer [mailto:[EMAIL PROTECTED] > Sent: Thursday,

Re: Using PHP to copy tables

2004-04-08 Thread Daniel Clark
Sound like a great idea! > Is there an easy way to create an HTML page that will copy selected tables > to backup copies on the same server? I want to create an administration > page for my client to be able to "backup" their database whenever they see > fit. But, I can't give them direct access

Re: Changing the primary key

2004-03-03 Thread Daniel Clark
You can ALTER TABLE http://www.mysql.com/doc/en/ALTER_TABLE.html > I´'m new with mysql and have following question: > > I have a table, that has a primary key with two columns and want to add a > third column to this primary key. > > Is this possible and when yes: Do I have to delete all tables,

Re: Query Problems

2004-02-25 Thread Daniel Clark
at was the way > to go. > > I'll try this, though. > > Eric > > At 10:36 AM 2/25/2004 -0800, Daniel Clark wrote: >>Do you have separate indexes on: >> >> Table1.ID >> Table2.ID >> Table1.Field1 >> Table2.Field1 >> Tabl

Re: Query Problems

2004-02-25 Thread Daniel Clark
Do you have separate indexes on: Table1.ID Table2.ID Table1.Field1 Table2.Field1 Table1.Field1 Table1.Field2 > Select* > FROM Table1 as a > INNER JOIN Table2 as b ON (a.ID = b.ID or (a.Field1 = b.Field1 and > a.Field2 = b.Field2)) > WHERE bla bla bla > > We ha

Re: Need help constructing query ...

2003-10-21 Thread Daniel Clark
> Hi, I have a table full of logged urls and ip addresses. The following > query returns all the urls and the number of requests. How would I > modify it to return unique requests based on distinct ip addresses? > > select url, count(*) as pageviews from table group by url order by > pageviews desc

Re: Simple query help

2003-08-29 Thread Daniel Clark
> select value from tableName where date in (select max(date) from > tableName where id = 4); > > But, it doesn't work with mysql 4.0. > > Any ideas? Does anybody had this problem before? What about: SELECT value, date FROM tablename WHERE id = 4 ORDER BY date ASC Just pick the first row.

seeing I cannot send the whole file...

2001-01-28 Thread Daniel Clark
I think I have stuffed up the installation of the MySQL thing. I am trying to get it installed onto a Debian box and am not having alot of luck :o| http://www.scanners.8m.com/config.html Any help would be appreciated, Cheers Dan Clark Information Systems System Support HealthCare Otago 5046