Re: Need help to query with timestamp in C++

2008-08-15 Thread Warren Young
Kandy Wong wrote: And what is the good connector (C++ to MySQL) to use? MySQL++ (http://tangentsoft.net/mysql++/) has native Date, Time, and DateTime data types. You can convert to these types implicitly: mysqlpp::DateTime dt = row[my_column]; Row::operator[] doesn't return

RE: Need help to query with timestamp in C++

2008-08-15 Thread Jerry Schwartz
PROTECTED] Sent: Friday, August 15, 2008 2:36 AM To: Saul Bejarano Cc: mysql@lists.mysql.com Subject: Re: Need help to query with timestamp in C++ Hi Saul, I need to use C++ and I'm not writing a web application. Thanks anyway. Kandy I have done queries to the database in PHP with variables like month

Re: Need help to query with timestamp in C++

2008-08-15 Thread Kandy Wong
Hi Dusan, Thank you so much. It works! Kandy Hi Kandy, this could be the query you are looking for. It should return record with the closest timestamp to your required time: (SELECT TIMEDIFF('20080815091907', timestamp_column) AS diff, t.* FROM table1 t WHERE timestamp_column =

Re: Need help to query with timestamp in C++

2008-08-14 Thread Saul Bejarano
I have done queries to the database in PHP with variables like month but easily can select from a range of time and data to produce the same results, the output goes directly to the web so if that is what you are seeking for, I can help with PHP. Saul Kandy Wong wrote: Hi, I need to write

Re: Need help to locate SetSRID(),Makebox2D(),Distance_Sphere()

2008-02-05 Thread Anders Karlsson
Rakesh! The distance_sphere and makebox2d functions are specific to postgis. MySQL GIS Implementation is based on the Open GIS Simple SQL Specification (read more on www.opengeospatial.com). The SetSRID is also not in the specification as far as I know (it should be, but I can't find it),

Re: Need help creating query statement

2007-11-07 Thread Néstor
Guys, just wanted to thank you again for helping me with the sql statement that I needed. I was able to sorted using php and I was able to display the correct result. Thanks again!!1 Nestor :-) On Nov 6, 2007 7:37 AM, Néstor [EMAIL PROTECTED] wrote: You guys are correct, that is exactly what

Re: Need help creating query statement

2007-11-06 Thread Enrique Sanchez Vela
--- [EMAIL PROTECTED] wrote: Néstor wrote: I think you'd best begin by normalising your database. Something along these lines: very true indeed, that would save you major headaches when right after finishing the demo, someone would say, can we add a 18 gallon pledge? what about a 25?

Re: Need help creating query statement

2007-11-06 Thread Néstor
You guys are correct, that is exactly what happened. I must thing of this in the future. At this moment I have a lot of other projects to take care, that it is eaiser for me to read the information into an associative array with the columns and the values and sort the array and then print the

Fwd: Re: Need help creating query statement

2007-11-05 Thread Enrique Sanchez Vela
--- Enrique Sanchez Vela [EMAIL PROTECTED] wrote: Date: Mon, 5 Nov 2007 15:01:59 -0800 (PST) From: Enrique Sanchez Vela [EMAIL PROTECTED] Subject: Re: Need help creating query statement To: Néstor [EMAIL PROTECTED] --- Néstor [EMAIL PROTECTED] wrote: I can do simple select

Re: Need help creating query statement

2007-11-05 Thread Néstor
Enrique that is pretty good and close to what I need. On top of what you have generously provide, I guess I can just put each gallon field into an array an then sort the array to display the first 5 gallon fields per agency. Is there an easier way? Thanks, Nestor :-) On 11/5/07, Enrique

Re: Need help creating query statement

2007-11-05 Thread mysql
Néstor wrote: I can do simple select statements but I need your brains to create query statment. I am using mysql 4.0 in my 1and1 site. I have a table that has 8 fields, one is the agency field and the other 7 are *tip* values on saving water and the value of this field is either 0 or an

Re: Need help with a sql query

2007-10-21 Thread mysql
Imran wrote: Hello all: ... I would like to get all of the records in MenuOptions and any record in MenuAccess with a specific fkGroupid. For example: ... IIf I run a query for fkgroupid = 1 I should get AccessId fkMenuID fkgroupid view execute

Re: Need help with a natural sort order for version numbers and release code names

2007-10-12 Thread Jay Pipes
Daevid Vincent wrote: I'm trying to get some 'release/version numbers' to sort properly. mysql SELECT ReleaseID, Name FROM releases ORDER BY Name DESC; +---+-+ | ReleaseID | Name| +---+-+ |18 |

RE: Need help with a natural sort order for version numbers and release code names

2007-10-12 Thread Daevid Vincent
-Original Message- From: Jay Pipes [mailto:[EMAIL PROTECTED] Sent: Friday, October 12, 2007 2:07 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: Re: Need help with a natural sort order for version numbers and release code names Daevid Vincent wrote: I'm trying

Re: Need help with a natural sort order for version numbers and release code names

2007-10-12 Thread Adam Randall
Here's my full test solution: use test; drop table if exists releases; create temporary table releases ( releaseid int(10) unsigned not null auto_increment primary key, name varchar(255) )engine=myisam; insert into releases ( name ) values ( 'Unspecified' ), ( 'Next Patch' ), (

Re: Need help with a natural sort order for version numbers and release code names

2007-10-12 Thread Adam Randall
Oh, and here's the output (Sorry): +---+-+ | releaseid | name| +---+-+ | 1 | Unspecified | | 2 | Next Patch | | 3 | LOCset | | 4 | Abashiri| |

Re: need help with delete query

2007-06-14 Thread Ben Liu
Thanks Brent, good tip. Works like a charm. On Jun 14, 2007, at 7:42 PM, Brent Baisley wrote: Here's a little trick. Get your DELETE query working as a SELECT. Then replace everything before FROM with DELETE tablename. SELECT order_items.ord_id FROM order_items LEFT JOIN orders ON

Re: need help with delete query

2007-06-14 Thread Reinhardt Christiansen
- Original Message - From: Ben Liu [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, June 14, 2007 3:11 PM Subject: need help with delete query I'm trying to delete a subset of items in a table. The problem is, I don't want to query for the subset first, store the results

Re: need help...LOAD DATA INFILE

2007-05-21 Thread Ananda Kumar
Hi All, I was able to load data properly. We need to set the parameter set session collation_database=latin1_swedish_ci; set session character_set_database=latin1; please check this url for more info http://lists.mysql.com/commits/16915 On 5/19/07, Ananda Kumar [EMAIL PROTECTED] wrote: Hi

Re: need help...LOAD DATA INFILE

2007-05-19 Thread Ananda Kumar
Also friends, When i see this data in the vi editor it looks like this Other Home DÃ(c)cor Just wanted to give information. Please help me. regards anandkl On 5/19/07, Ananda Kumar [EMAIL PROTECTED] wrote: Hi All, I am loading data into mysql database using LOAD DATA INFILE. After the load

Re: Need help with query

2007-05-01 Thread Baron Schwartz
Hi Jesse, Jesse wrote: The following query works just fine: SELECT B.BusNum, COALESCE(CampCount.Cnt,0) As Kids, B.CamperCapacity, COALESCE(CounselorCount.Cnt,0) As Adults, B.AdultCapacity FROM Buses B LEFT JOIN (SELECT BusID,Count(*) As Cnt FROM Campers GROUP BY BusID) AS CampCount ON

Re: Need help with query

2007-05-01 Thread Jesse
COALESCE(CampCount.Cnt,0) + COALESCE(CounselorCount.Cnt,0) as GT Duuuh. Why didn't I think of that. What is MySQL's issue with referring to the variables (As assignments, whatever you want to call them)? I've had issues like this in situations like this one, when trying to use them in the

Re: Need help with query

2007-05-01 Thread Mark Leith
Jesse wrote: COALESCE(CampCount.Cnt,0) + COALESCE(CounselorCount.Cnt,0) as GT Duuuh. Why didn't I think of that. What is MySQL's issue with referring to the variables (As assignments, whatever you want to call them)? I've had issues like this in situations like this one, when trying to

Re: need help urgent

2007-03-30 Thread Ananda Kumar
Hi Rakaha, You have a cursor , select id from table_name and then have a loop where in you select values of LTA for each id got from the above cursor, close the loop once all the ID have been processed. regards anandk On 3/30/07, raksha [EMAIL PROTECTED] wrote: How to retrieve data from

Re: need help urgent

2007-03-30 Thread Ananda Kumar
Or you could also do this. SELECT LTA FROM TABLE A WHERE ID IN (SELECT B.ID FROM TABLE B); i hope this what your looking at, please let us know. regards anandkl On 3/30/07, Ananda Kumar [EMAIL PROTECTED] wrote: Hi Rakaha, You have a cursor , select id from table_name and then have a loop

Re: need help on before insert trigger

2006-10-07 Thread Paul DuBois
At 16:23 +0200 10/7/06, Patrick Aljord wrote: I would like to prohibit the value 'xxx' on my column title, and if it does contain the value I would like to create an exception by assigning 'xxx' to the primary key id which is int(5). This is what I do but I get an error on its creation so I

Re: need help on before insert trigger

2006-10-07 Thread Mark Leith
Hi Patrick, Patrick Aljord wrote: I would like to prohibit the value 'xxx' on my column title, and if it does contain the value I would like to create an exception by assigning 'xxx' to the primary key id which is int(5). This is what I do but I get an error on its creation so I guess it's not

Re: need help on before insert trigger

2006-10-07 Thread Patrick Aljord
I meant the error is: mysql CREATE TRIGGER testref BEFORE INSERT ON bookmarks - FOR EACH ROW - BEGIN - IF NEW.title LIKE '%xxx%' THEN - SET NEW.id ='xxx'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for

Re: need help on before insert trigger

2006-10-07 Thread Patrick Aljord
thanx it works the trigger is created successfully but it has no effect. here it is: delimiter // create trigger testref before insert on bookmarks for each row begin declare dummy char(2); if new.title like '%xxx%' then set new.id='xxx'; end if; end; //create

Re: need help on before insert trigger

2006-10-07 Thread Patrick Aljord
On 10/7/06, Patrick Aljord [EMAIL PROTECTED] wrote: thanx it works the trigger is created successfully but it has no effect. here it is: delimiter // create trigger testref before insert on bookmarks for each row begin if new.title like '%xxx%' then set new.id='xxx';

Re: Need help on EXPLAIN in rating queries

2006-08-01 Thread Aleksandar Bradaric
Hi, I am trying to JOIN 2 tables TBL1 and TBL2 on TBL1.fld_id = TBL2.fld_id . And finally I filter out the results that i need in the where clause using where TBL1.fld_col = 100; Running an EXPLAIN shows that it is an impossible where condition. This may be because there may be no rows

Re: Need help querying a database of polynomials

2006-06-01 Thread Michael Stassen
Lew E. Lefton wrote: Hi, I hope this is an appropriate place to ask this question, if you think it is better suited for another list/forum, please let me know. I have a table that looks like this: mysql select polynomial_id, term_id from polynomial; +---+-+ |

Re: Need help querying a database of polynomials

2006-05-31 Thread Peter Brawley
Lew, If I have another polynomial, say the sum of terms 1,3,4, and 5, how can I quickly search this database to see if it's already been stored? SELECT DISTINCT polynomial_id FROM polynomial p1 INNER JOIN polynomial p2 ON p1.term_id=1 AND p2.term_id=3 INNER JOIN polynomial p3 ON p2.term_id=3

Re: Need help querying a database of polynomials

2006-05-31 Thread Pooly
2006/5/31, Peter Brawley [EMAIL PROTECTED]: Lew, If I have another polynomial, say the sum of terms 1,3,4, and 5, how can I quickly search this database to see if it's already been stored? SELECT DISTINCT polynomial_id FROM polynomial p1 INNER JOIN polynomial p2 ON p1.term_id=1 AND

Re: Need help with triggers

2006-05-15 Thread Martijn Tonies
Daevid, This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup in the zipcode table. DELIMITER $$; DROP TRIGGER `store_coord`$$ create trigger `store_coord`

Re: Need help with prcedures

2006-05-15 Thread sheeri kritzer
You cannot get data out of a database if it's not in the database. If there's no data for a day, you cannot get 0 for that day, because the day does not exist in the database. You could make a calendar table, one row per day, and join it with a count to get 0 for the day. -Sheeri On 5/15/06,

Re: need help in updating old binary files to database slave

2006-05-15 Thread sheeri kritzer
I've had this same problem -- if the database loses connection at the same time the log file flushes, you need to SET MASTER_LOG_FILE and MASTER_LOG_POS again and restart. I believe this probably qualifies as a bug if you want to report it. The reason the slave isn't updating log5 is because

Re: Need help with procedure

2006-05-15 Thread Peter Brawley
Barry wrote: Hello everyone! snip I have a table with saved clicks by users. Now i want to draw a graph with a php extension. Problem is: if i let me show the clicks, one day is missing. Because on that day noone clicked on the link. I use this query: SELECT DATE(c_clicktime) AS clicktime,

RE: Need help with triggers

2006-05-15 Thread Daevid Vincent
This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup in the zipcode table. DELIMITER $$; DROP TRIGGER `store_coord`$$ create trigger

RE: Need help with triggers

2006-05-15 Thread Quentin Bennett
May 2006 2:41 p.m. To: 'Martijn Tonies'; mysql@lists.mysql.com Subject: RE: Need help with triggers This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup

Re: Need help with triggers

2006-05-15 Thread Peter Brawley
Daevid, This is my first trigger I'm trying to write. I have two tables. 'stores' and 'zipcodes'. I want to automatically set the latitude and longitude of the store using it's zipcode lookup in the zipcode table. DELIMITER $$; DROP TRIGGER `store_coord`$$ create trigger

Re: Need help in recreating .MYD files

2006-05-11 Thread Pradeep Chandru
hi, Just to add up i have read some where ( i assume in the mailing list only) that OS recognizes the file based on few codes added at the starting / ending of a file. So there are ways to create a MYD file through vi editor as well (this is not from the angle of restoring the data in that

Re: Need help in recreating .MYD files

2006-05-10 Thread balaraju mandala
*Ok Daniel,* ** * Thank you.* ** *regards,* *bala* **

Re: Need help in recreating .MYD files

2006-05-09 Thread Dilipkumar
Hi, please tell me the server uptime and also the master logs as show master logs; in mysql prompt. Yes u can restore data from the binlog if you have the binlogs. balaraju mandala wrote: Hi Dilip, it means i loosed the data, correct Dilip. is there any other way to gain that data, any

Re: Need help in recreating .MYD files

2006-05-09 Thread balaraju mandala
Hi Dilip, I got two binary logs in Server. I don't know how to find server uptime? mysql show master logs; +--+ | Log_name | +--+ | localhost-bin.08 | | localhost-bin.09 | +--+ 2 rows in set (0.00 sec) if i ask for

Re: Need help in recreating .MYD files

2006-05-09 Thread Daniel da Veiga
On 5/9/06, balaraju mandala [EMAIL PROTECTED] wrote: Hi Dilip, I got two binary logs in Server. I don't know how to find server uptime? mysql show master logs; +--+ | Log_name | +--+ | localhost-bin.08 | | localhost-bin.09 |

Re: Need help in recreating .MYD files

2006-05-09 Thread balaraju mandala
Thank you Daniel for reply. Just in curiocity i want ask u, how u r taking daily backups, just using 'mysqldump' or using any Tools. regards, bala

Re: Need help in recreating .MYD files

2006-05-09 Thread Daniel da Veiga
On 5/9/06, balaraju mandala [EMAIL PROTECTED] wrote: Thank you Daniel for reply. Just in curiocity i want ask u, how u r taking daily backups, just using 'mysqldump' or using any Tools. I'm using mysqldump plus bzip2 to compress data for about 2 years now. Tried many tools, mysqldump

Re: Need help in recreating .MYD files

2006-05-08 Thread Dilipkumar
Hi, If you have deleted .MYD files then truncate the table and restore it from the backup if yu have. MYD means your precious data which contains. balaraju mandala wrote: Dear Comunity, I need your help. I accidently deleted some '.MYD' files. I want to restore them, without stopping

Re: Need help in recreating .MYD files

2006-05-08 Thread balaraju mandala
Hi Dilip, it means i loosed the data, correct Dilip. is there any other way to gain that data, any binary logs etc? regards, bala

Re: need help for my jointure

2006-04-27 Thread Patrick Aljord
On 4/26/06, Shawn Green [EMAIL PROTECTED] wrote: --- Patrick Aljord [EMAIL PROTECTED] wrote: On 4/26/06, Patrick Aljord [EMAIL PROTECTED] wrote: I have a table confs like this: id int 5 auto_increment primary key; conf text; and another table conf_ip like this: id int 5

Re: need help for my jointure

2006-04-26 Thread Shawn Green
--- Patrick Aljord [EMAIL PROTECTED] wrote: I have a table confs like this: id int 5 auto_increment primary key; conf text; and another table conf_ip like this: id int 5 auto_increment primary key; conf_id int 5; ==foreing key of confs ip varchar 150; I would like to select id,

Re: need help for my jointure

2006-04-26 Thread Patrick Aljord
On 4/26/06, Patrick Aljord [EMAIL PROTECTED] wrote: I have a table confs like this: id int 5 auto_increment primary key; conf text; and another table conf_ip like this: id int 5 auto_increment primary key; conf_id int 5; ==foreing key of confs ip varchar 150; ok, sorry all for not being

Re: need help for my jointure

2006-04-26 Thread Shawn Green
--- Patrick Aljord [EMAIL PROTECTED] wrote: On 4/26/06, Patrick Aljord [EMAIL PROTECTED] wrote: I have a table confs like this: id int 5 auto_increment primary key; conf text; and another table conf_ip like this: id int 5 auto_increment primary key; conf_id int 5; ==foreing key

Re: need help for my jointure

2006-04-25 Thread Rhino
First of all, I'm going to guess that English is not your first language and tell you that jointure is not the word normally to describe the process of combining two tables in a database: the word you want is joining. Second, there are many kinds of joins and you haven't specified which kind

Re: need help to delete duplicates

2006-04-17 Thread William Fong
Sample Data: ID-Row1-Row2 1-A-B 2-A-B Row1 and Row2 are duplicate, so you only want one. Which ID do you want? -will On 4/17/06, Patrick Aljord [EMAIL PROTECTED] wrote: hey all, I have a table mytable that looks like this: id tinyint primary key auto_increment row1 varchar 150 row2

Re: need help to delete duplicates

2006-04-17 Thread William Fong
If the ID doesn't represent anything, you can CREATE TABLE new_table SELECT DISTINCT Row1, Row2 FROM old_table And then recreate your index(es). All your autoincrement IDs will be changed. On 4/17/06, Patrick Aljord [EMAIL PROTECTED] wrote: On 4/18/06, William Fong [EMAIL PROTECTED] wrote:

Re: Need help with a Basic Query.

2006-03-09 Thread Peter Brawley
clint lenard wrote: Hey Guys, I was wondering if I could get some assistance with building a Simple Import Script using PHP and MySQL. Basically I'm trying to pull info out of one Table and Insert it into the other Table. Can anyone show me a simple example of this? I can figure out how to

RE: Need help with a Basic Query.

2006-03-08 Thread Nicolas Verhaeghe
That SQL 101. It's a basic INSERT / SELECT. http://dev.mysql.com/doc/refman/4.1/en/insert-select.html Scroll down for the examples. -Original Message- From: clint lenard [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 08, 2006 8:54 PM To: mysql@lists.mysql.com Subject: Need help with

Re: Need help with a Basic Query.

2006-03-08 Thread mysql
13.1.5.1. Silent Column Specification Changes CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [select_statement] ^^^ Regards Keith In theory, theory and practice are the same; In practice they are not. On

Re: Need help configuring INNODB (Customer is ready to sue)

2006-02-09 Thread Gary Richardson
What are the problems you've been experiencing? Did you convert all tables? How big is the database? On 2/9/06, Shaun Adams [EMAIL PROTECTED] wrote: I have a customer who has been in production for a few weeks now having converted from MyISM to INNODB. We have been experiencing a few problems

Re: Need help configuring INNODB (Customer is ready to sue)

2006-02-09 Thread Heikki Tuuri
Shaun, the my.cnf looks ok. You might be able to raise the InnoDB buffer pool size to 3G, but beware swapping. SHOW INNODB STATUS looks ok, though it would be more informative if it were taken during a typical workload. Free buffers 0 Having free buffers 0 is very normal. Buffers

Re: Need help with a query

2006-01-23 Thread Michael Stassen
Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given that I am getting new data, and the data entry folks may create a

Re: Need help with a query

2006-01-23 Thread Mark Phillips
On Monday 23 January 2006 03:33 pm, Michael Stassen wrote: Mark Phillips wrote: I am running mysql 4.0.24 on Debian sarge. I have a table with two columns, team and division, both varchar(255). There are some errors in the table where division has a value but team is blank. Given

Re: Need help counting player with lowest score for each week.

2006-01-09 Thread Thomas 'Skip' Hollowell
OK, turns out this was a two fold issue. The server I was on had 4.0 mySQL, which was severely limited in it's abilities to use subqueries. The server has since been update to the 4.1 series, and now the following 2-subquery query work just fine. SELECT firstname, lastname, B.playerid,

Re: need help with user variables in where clause of sub query

2005-12-29 Thread Dan Rossi
Thanks for your kind words of opinion, if you feel you have a better way please do go ahead , i am going to show you the sql i ended up using which was a union to append the current summary at the end, i then had to use php afterwards to add up the totals as i was getting unexpected results

Re: need help with user variables in where clause of sub query

2005-12-29 Thread SGreen
Dan Rossi [EMAIL PROTECTED] wrote on 12/29/2005 07:19:13 AM: Thanks for your kind words of opinion, if you feel you have a better way please do go ahead , i am going to show you the sql i ended up using which was a union to append the current summary at the end, i then had to use php

Re: Need Help Writing a Trigger

2005-12-28 Thread Jesse
It's not as simple as that. First, if you subtract the curdate() from the birthday (or vice versa), you end up with some large number that isn't the actual age at all. So, the calculation is a bit more complicated than that. Also, I'm not interested in their current age, but their age at the

Re: Need Help Writing a Trigger

2005-12-28 Thread Peter Brawley
Jesse, Therefore, instead of putting that long calculation in my query every time, I'm looking for a simpler solution, a more automatic one. CREATE FUNCTION Age( dob DATE, today DATE ) RETURNS INTEGER DETERMINISTIC BEGIN RETURN DATE_FORMAT(FROM_DAYS(TO_DAYS(today) - TO_DAYS(dob)), '%Y') + 0;

Re: need help with user variables in where clause of sub query

2005-12-28 Thread SGreen
You seem to be coming at SQL with a COBOL perspective. Views are something you typically create just once and they stay updated automatically. They work like tables not like queries. Assigning variables to each column of a view doesn't make any sense (in the SQL sense of view) as each column

Re: Need Help Writing a Trigger

2005-12-28 Thread Jesse
, Jesse - Original Message - From: Peter Brawley [EMAIL PROTECTED] To: Jesse [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Wednesday, December 28, 2005 10:20 AM Subject: Re: Need Help Writing a Trigger Jesse, Therefore, instead of putting that long calculation in my query

Re: Need Help Writing a Trigger

2005-12-28 Thread Peter Brawley
] To: Jesse [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Wednesday, December 28, 2005 10:20 AM Subject: Re: Need Help Writing a Trigger Jesse, Therefore, instead of putting that long calculation in my query every time, I'm looking for a simpler solution, a more automatic one

Re: Need Help Writing a Trigger

2005-12-28 Thread Jesse
] To: Jesse [EMAIL PROTECTED] Cc: MySQL List mysql@lists.mysql.com Sent: Wednesday, December 28, 2005 1:48 PM Subject: Re: Need Help Writing a Trigger Jesse, BTW, is there a way to change this function so that it does away with the today variable, and uses a field from a different database? For instance

Re: need help with user variables in where clause of sub query

2005-12-28 Thread Dan Rossi
Um, thast exactly right each select is a list of results , i want to merge them then manipulate the data after putting them into a view, maybe a temp table is needed for this but i dont really want to do an entire create table statement aswell :\ On 29/12/2005, at 2:48 AM, [EMAIL PROTECTED]

Re: need help with user variables in where clause of sub query

2005-12-28 Thread Dan Rossi
Btwi dont want the column of a view to be a variable, i think thats what it thinks ! Im just needing to send the value of the current primary key field top a sub query ! Read my latest post if i can get around not using variables, and still manage to get the right values of a current row

Re: need help with user variables in where clause of sub query

2005-12-28 Thread Dan Rossi
I just tried to create a Function or Stored Procedure instead of making variables but it didnt even let me do this CREATE FUNCTION test (customerID, month, producerID) RETURN SELECT SUM(fu.bandwidth) FROM feed_usage fu WHERE fu.customerID=customerID AND fu.month=month AND fu.feedID IN (SELECT

Re: need help with user variables in where clause of sub query

2005-12-28 Thread SGreen
Dan, You need to shoot your SQL tutor. Whoever taught you to write aggregate queries seriously took your money. You DO NOT need to use subqueries to do what you want to do. You do not need to write a full CREATE TABLE statement to create a temporary table (see other response). You do not need

Re: Need Help Writing a Trigger

2005-12-27 Thread John Meyer
On Tuesday 27 December 2005 2:34 pm, Jesse wrote: I'm trying to write a trigger that will update the age of a camper when ever a record is updated or inserted. I have a table named Campers which contains basic information about the camper as well as their birthday. I have another table named

Re: need help with user variables in where clause of sub query

2005-12-27 Thread SGreen
Dan Rossi [EMAIL PROTECTED] wrote on 12/27/2005 11:39:57 PM: Hi there i am trying to use usewr variables in a select statement to add to a where clause in a sub query. Ie select @id:=id,@month:=month, (select SUM(totals) from table where [EMAIL PROTECTED] and [EMAIL PROTECTED]) as totals

Re: need help with user variables in where clause of sub query

2005-12-27 Thread Dan Rossi
I have an unfinished query, i am trying to test, basically im required to get the value of the current field in a row and use it for a subquery in that row :| Its not a working query, and im not asking for someone to fix it, however as u can see i need to send the customerID and month to the

Re: Need Help Connecting

2005-12-22 Thread Michael Stassen
Mark Phillips wrote: David, This is what I got: [EMAIL PROTECTED]:~$ aliases bash: aliases: command not found Your shell is bash, so the correct command is `alias`. [EMAIL PROTECTED]:~$ which mysql /usr/bin/mysql Since you are using bash, it's a better idea to use `type` instead of

Re: Need Help Connecting

2005-12-22 Thread Mark Phillips
Here are the results of alias and type [EMAIL PROTECTED]:~$ alias alias ls='ls --color=auto' [EMAIL PROTECTED]:~$ type mysql mysql is /usr/bin/mysql And for the emily account: [EMAIL PROTECTED]:/home/mark$ alias alias ls='ls --color=auto' [EMAIL PROTECTED]:/home/mark$ type mysql mysql is

Re: need help

2005-12-22 Thread SGreen
You will experience the same problem with old-client vs. new-server authentication as you did when you first set up your user accounts for 4.1 but other than that , it should be compatible. http://dev.mysql.com/doc/refman/5.0/en/old-client.html Shawn Green Database Administrator Unimin

Re: need help

2005-12-22 Thread Gleb Paharenko
Hello. In my opinion, if it works in general with 5.0. MySQL tries to keep backward compatibility for its products as much as possible. So it should work, however, not all features of 5.0 could be available. MyODBC 3.51.12 is suitable for use with any MySQL version including MySQL 4.1 or

RE: Need Help Connecting

2005-12-21 Thread Logan, David (SST - Adelaide)
Hi Mark, Have you checked to see if you any aliases set? It might be using that instead of the mysql command. May well be worth checking your path to ensure you aren't picking up a script called mysql or something similar. Regards David Logan Database Administrator HP Managed Services 148

Re: Need Help Connecting

2005-12-21 Thread Mark Phillips
David, How do I do that? Thanks! Mark On Wednesday 21 December 2005 11:37 pm, Logan, David (SST - Adelaide) wrote: Hi Mark, Have you checked to see if you any aliases set? It might be using that instead of the mysql command. May well be worth checking your path to ensure you aren't

RE: Need Help Connecting

2005-12-21 Thread Logan, David (SST - Adelaide)
+61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Mark Phillips [mailto:[EMAIL PROTECTED] Sent: Thursday, 22 December 2005 5:21 PM To: mysql@lists.mysql.com Cc: Logan, David (SST - Adelaide) Subject: Re: Need Help Connecting David, How do I do that? Thanks

Re: Need Help Connecting

2005-12-21 Thread Mark Phillips
8 8408 4259 - Fax -Original Message- From: Mark Phillips [mailto:[EMAIL PROTECTED] Sent: Thursday, 22 December 2005 5:21 PM To: mysql@lists.mysql.com Cc: Logan, David (SST - Adelaide) Subject: Re: Need Help Connecting David, How do I do that? Thanks! Mark On Wednesday 21

RE: Need Help Connecting

2005-12-21 Thread Logan, David (SST - Adelaide)
+61 417 268 665 - Mobile +61 8 8408 4259 - Fax -Original Message- From: Mark Phillips [mailto:[EMAIL PROTECTED] Sent: Thursday, 22 December 2005 5:36 PM To: Logan, David (SST - Adelaide) Cc: mysql@lists.mysql.com Subject: Re: Need Help Connecting David, This is what I got: [EMAIL

Re: Need Help with a query

2005-12-12 Thread Gleb Paharenko
Hello. You may use these queries: select flight_id ,baseline*tan(radians(angle)) as attitude from flights where (baseline*tan(radians(angle))) = ( select max(baseline*tan(radians(angle))) from flights f2);

Fwd: Re: Need Help with a query

2005-12-11 Thread Mark Phillips
I forgot to copy the list as well Mark -- Forwarded Message -- Subject: Re: Need Help with a query Date: Sunday 11 December 2005 06:47 pm From: Mark Phillips [EMAIL PROTECTED] To: Rhino [EMAIL PROTECTED] Rhino, My apologies for leaving out the version of mysql. I agree

Re: Need help with fulltext search and left join

2005-10-23 Thread Stefan Kuhn
For me, it looks as if you confused the order of join and where. It should be: select ... from ... join ... where ... order by ... Stefan Am Sunday 23 October 2005 13:21 schrieb Grant Giddens: Hi, I keep getting errors on this query and I'm not sure why. I'm using mysql version 4.0.22.

Re: need help with foreign keys, new to mysql

2005-10-18 Thread Enrique Sanchez Vela
--- Kishore Jalleda [EMAIL PROTECTED] wrote: check the permissions on the mysql data dir, may be the user mysql or who ever runs mysql does not have sufficient privileges Kishore Jalleda I agree with Kishore, to elaborate his answer a little longer I would ask the following. - is

Re: need help with foreign keys, new to mysql

2005-10-18 Thread Enrique Sanchez Vela
ps, I meant to delete the note from my draft folder... sorry Enrique Sanchez. Enrique Sanchez Vela email: [EMAIL PROTECTED] - It's often easier to fight for one's ||We live in the outer space

RE: need help with foreign keys, new to mysql

2005-08-24 Thread John Gonzales
: need help with foreign keys, new to mysql Sorry to reply to my own message, but I meant to add that you can read about defining foreign key constrints in the manual http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html. [jg.] thanks, this is what I originally based my command off

RE: need help with foreign keys, new to mysql

2005-08-24 Thread Pat Adams
On Wed, 2005-08-24 at 06:11 -0500, John Gonzales wrote: CREATE TABLE `journal` ( `journal_id` int(10) unsigned NOT NULL auto_increment, `journal_category` int(10) unsigned NOT NULL default '1', `journal_datetime_created` timestamp NOT NULL default CURRENT_TIMESTAMP,

Re: need help with foreign keys, new to mysql

2005-08-24 Thread Roger Baklund
Pat Adams wrote: On Wed, 2005-08-24 at 06:11 -0500, John Gonzales wrote: CREATE TABLE `journal` ( `journal_id` int(10) unsigned NOT NULL auto_increment, [snip] CREATE TABLE comments ( comment_id INT, comment_journal_id INT, INDEX jrn_id (journal_id), Here you are defining an index

RE: need help with foreign keys, new to mysql

2005-08-24 Thread John Gonzales
Wow, thanks both of you. It worked... =) -Original Message- From: Roger Baklund [mailto:[EMAIL PROTECTED] Sent: August 24, 2005 9:17 AM To: mysql@lists.mysql.com Cc: [EMAIL PROTECTED] Subject: Re: need help with foreign keys, new to mysql Pat Adams wrote: On Wed, 2005-08-24 at 06:11

RE: need help with foreign keys, new to mysql

2005-08-20 Thread John Gonzales
i am logged in as root -JG. -Original Message- From: Kishore Jalleda [mailto:[EMAIL PROTECTED] Sent: August 19, 2005 10:35 PM To: John Gonzales Cc: mysql@lists.mysql.com Subject: Re: need help with foreign keys, new to mysql check the permissions on the mysql data dir, may be the user

Re: need help with foreign keys, new to mysql

2005-08-20 Thread Jasper Bryant-Greene
Yes but is the MySQL daemon running as root? I hope it isn't... Jasper John Gonzales wrote: i am logged in as root -JG. -Original Message- From: Kishore Jalleda [mailto:[EMAIL PROTECTED] Sent: August 19, 2005 10:35 PM To: John Gonzales Cc: mysql@lists.mysql.com Subject: Re: need

<    1   2   3   4   5   6   >