Re: Complex MySQL Select Statement Help

2013-02-03 Thread hsv
2013/02/02 12:58 -0600, Peter Brawley On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice )

Re: Complex MySQL Select Statement Help

2013-02-02 Thread hsv
2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price From catalog Where itemid='WB314'; PB Maybe this is gilding the

Re: Complex MySQL Select Statement Help

2013-02-02 Thread Peter Brawley
On 2013-02-01 10:18 PM, h...@tbbs.net wrote: 2013/01/31 22:24 -0600, Peter Brawley Is this what you mean? Select, pricelist If( !IsNull(specialprice) And specialprice unitprice And CurDate() Between startingDate And endingDate, specialprice, unitprice ) as used_price From catalog Where

Complex MySQL Select Statement Help

2013-01-31 Thread Angela Barone
Hello, I'm trying to write a select query that grabs two prices from my db and displays them on a web page. I want it to grab the `listprice`, and either the `unitprice` or the `specialprice` depending on the following criteria: if the `specialprice` is not empty, AND it's less than

Re: Complex MySQL Select Statement Help

2013-01-31 Thread Peter Brawley
On 2013-01-31 8:13 PM, Angela Barone wrote: Hello, I'm trying to write a select query that grabs two prices from my db and displays them on a web page. I want it to grab the `listprice`, and either the `unitprice` or the `specialprice` depending on the following criteria: if the

Re: Select statement help

2008-01-18 Thread Baron Schwartz
Hi, On Jan 18, 2008 2:59 PM, RoryGRen [EMAIL PROTECTED] wrote: Hi all I am quite new to mySQL and have the following question I hope someone can help me with: I have a database table imported directly from MS Access with two of the field names having brackets - F(1) and S(1). I don't want

Select statement help

2008-01-18 Thread RoryGRen
the database needs updating. How can I select these fields from the table? - SELECT F(1), S(1) doesn't work, SELECT F(1) , S(1) doesn't work and neither does SELECT [F(1)], [S(1)] Thanks, in anticipation! Rory -- View this message in context: http://www.nabble.com/Select-statement-help

RE: SQL Statement Help

2005-12-14 Thread Charles Walmsley
. With best wishes Ch -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 14 December 2005 19:22 To: Jesse Cc: mysql@lists.mysql.com Subject: Re: SQL Statement Help Jesse [EMAIL PROTECTED] wrote on 12/14/2005 02:03:22 PM: Hello, I need

SQL Statement Help

2005-12-14 Thread Jesse
Hello, I need help building a SQL Statement. I'm currently using MySQL 5.something. This one is kind of strange, and I can't seem to figure out how to do it. I have a table named Participants. Each Participant is allowed to bring up to 5 Guests. Instead of putting the names in a separate

Re: SQL Statement Help

2005-12-14 Thread Martijn Tonies
Hello, I need help building a SQL Statement. I'm currently using MySQL 5.something. This one is kind of strange, and I can't seem to figure out how to do it. I have a table named Participants. Each Participant is allowed to bring up to 5 Guests. Instead of putting the names in a

Re: SQL Statement Help

2005-12-14 Thread SGreen
Jesse [EMAIL PROTECTED] wrote on 12/14/2005 02:03:22 PM: Hello, I need help building a SQL Statement. I'm currently using MySQL 5.something. This one is kind of strange, and I can't seem to figure out how to do it. I have a table named Participants. Each Participant is allowed to

Re: SQL statement help

2005-10-17 Thread Terence
it for you. UPDATE table_one t1, table_two t2 SET t1.ID = t2.ID WHERE t2.num = t1.num AND t1.ID = 0 J.R. -Original Message- From: C.F. Scheidecker Antunes [mailto:[EMAIL PROTECTED] Sent: Sunday, October 16, 2005 1:45 PM To: mysql@lists.mysql.com Subject: SQL statement help Importance

Re: SQL statement help

2005-10-17 Thread SGreen
PROTECTED] Sent: Sunday, October 16, 2005 1:45 PM To: mysql@lists.mysql.com Subject: SQL statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL

SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY IF the ID on one is zero. That is, if the ID on table one is not set

RE: SQL statement help

2005-10-16 Thread J.R. Bullington
To: mysql@lists.mysql.com Subject: SQL statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY

Re: SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set the ID from table 1 to the ID from table 2 ONLY IF the ID on one is zero. That is, if the ID

Re: SQL statement help

2005-10-16 Thread C.F. Scheidecker Antunes
PROTECTED] Sent: Sunday, October 16, 2005 1:45 PM To: mysql@lists.mysql.com Subject: SQL statement help Importance: High Hello All, I have two MySQL 4.1 tables. The first table has an ID field which is set to zero. The second one has ID fields and filenames. I need a single SQL statement to set

if statement help

2005-03-30 Thread Christopher Vaughan
I have data in a table listed as 44:22:22 333:33:33 It stands for hhh:mm:ss I want to break each part of the data into different parts based on the ':' to separate them. Then I want to take that data and sum it. I wrote an if statement to parse through this table but I can't get it to work.

RE: if statement help

2005-03-30 Thread Tom Crimmins
On Wednesday, March 30, 2005 09:49, Christopher Vaughan wrote: I have data in a table listed as 44:22:22 333:33:33 It stands for hhh:mm:ss If you convert it to a time field you can use mysql built-in functions to do what you want. You are limited to the range -838:59:59 to 838:59:59

RE: if statement help

2005-03-30 Thread Tom Crimmins
On Wednesday, March 30, 2005 10:24, Christopher Vaughan wrote: Tom Crimmins on Wednesday, March 30, 2005 at 11:10 AM -0500 wrote: If you convert it to a time field you can use mysql built-in functions to do what you want. You are limited to the range -838:59:59 to 838:59:59 though.

Re: if statement help

2005-03-30 Thread Dan Bolser
I think I remember a match_at(:) or pat_index(:) UDF which would return the position of the first : for you, but I can't find it if it does exist. On Wed, 30 Mar 2005, Christopher Vaughan wrote: I have data in a table listed as 44:22:22 333:33:33 It stands for hhh:mm:ss I want to break each

Re: if statement help

2005-03-30 Thread Alec . Cawley
Christopher Vaughan [EMAIL PROTECTED] wrote on 30/03/2005 16:48:47: I have data in a table listed as 44:22:22 333:33:33 It stands for hhh:mm:ss I want to break each part of the data into different parts based on the ':' to separate them. Then I want to take that data and sum it. I wrote

FW: if statement help

2005-03-30 Thread Tom Crimmins
Just forwarding this to the list. On Wednesday, March 30, 2005 10:43, Christopher Vaughan wrote: Tom Crimmins on Wednesday, March 30, 2005 at 11:31 AM -0500 wrote: Look at the functions HOUR(time), MINUTE(time), SECOND(time). These will give you interger output for each part of the time

Like statement help

2005-01-18 Thread Craig Hoffman
Hi There, I have web form where a user can search certain fields and then have them displayed aggregated. For example, find all the routes I climbed with partner A in area(s) ALL (% - wildcard) between date1 and date2 -- so on. See below for the complete query. I'm using pull down menu's and

Re: Like statement help

2005-01-18 Thread SGreen
Craig Hoffman [EMAIL PROTECTED] wrote on 01/18/2005 04:17:30 PM: Hi There, I have web form where a user can search certain fields and then have them displayed aggregated. For example, find all the routes I climbed with partner A in area(s) ALL (% - wildcard) between date1 and date2 -- so

RE: In Statement Help

2004-08-03 Thread Andrew Dixon
Hi Rhino I had pretty much already suggested doing that, but I have been told that I'm not allowed to redesign the database as there is already lots other code working on it already that would need changing as well. I personally think the database design is terrible, but I have to work with what

Re: In Statement Help

2004-08-03 Thread Stephen E. Bacher
Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. I require some help with an IN statement I'm trying to get working. I have inherited a database from someone else in which there is a table with project information and a field containing which geographic regions the projects relate. As a single

RE: In Statement Help

2004-08-03 Thread Andrew Dixon
Hi. Thanks Stephen, the works like a dream... Unlike this database which is more like a nightmare!!! Best Regards Andrew. -Original Message- From: Stephen E. Bacher [mailto:[EMAIL PROTECTED] Sent: 03 August 2004 12:16 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: In Statement

RE: In Statement Help

2004-08-03 Thread Martin Gainty
://archives.postgresql.org/pgsql-performance/2002-12/msg00185.php HTH, Martin Gainty From: Andrew Dixon [EMAIL PROTECTED] To: 'Stephen E. Bacher' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: In Statement Help Date: Tue, 3 Aug 2004 12:27:25 +0100 MIME-Version: 1.0 Received: from lists.mysql.com

Re: In Statement Help

2004-08-03 Thread Michael Stassen
: Stephen E. Bacher [mailto:[EMAIL PROTECTED] Sent: 03 August 2004 12:16 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: In Statement Help Andrew Dixon [EMAIL PROTECTED] wrote: Hi Everyone. I require some help with an IN statement I'm trying to get working. I have inherited a database from someone

Re: In Statement Help

2004-08-03 Thread Michael Stassen
Martin Gainty wrote: Andrew et al- Keep in mind that when you use LIKE you will NOT use an index but you will use a full table scan instead. Agreed. Also instead of using IN EXISTS uses Indexes on the master table query..if you have master-heavy or parent-heavy query use EXISTS/NOT EXISTS vs

Re: In Statement Help

2004-08-03 Thread Jochem van Dieten
On Tue, 03 Aug 2004 06:50:46 -0600, Martin Gainty wrote: Keep in mind that when you use LIKE you will NOT use an index but you will use a full table scan instead Also instead of using IN EXISTS uses Indexes on the master table query..if you have master-heavy or parent-heavy query use

Re: In Statement Help

2004-08-03 Thread Martin Gainty
is Indexed- Martin Gainty From: Michael Stassen [EMAIL PROTECTED] To: Martin Gainty [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: In Statement Help Date: Tue, 03 Aug 2004 10:26:29 -0400 MIME-Version: 1.0 Received: from out011.verizon.net

In Statement Help

2004-08-02 Thread Andrew Dixon
Hi Everyone. I require some help with an IN statement I'm trying to get working. I have inherited a database from someone else in which there is a table with project information and a field containing which geographic regions the projects relate. As a single project can relate to multiple

Re: In Statement Help

2004-08-02 Thread Rhino
- Original Message - From: Andrew Dixon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 02, 2004 9:44 AM Subject: In Statement Help Hi Everyone. I require some help with an IN statement I'm trying to get working. I have inherited a database from someone else in which

Re: SQL Statement Help - Is this possible?

2003-12-11 Thread spamtrap
) AND NOT EXISTS ( SELECT * FROM load_cntl AS B WHERE B.LOAD_DATE = DATEADD(A.LOAD_DATE, 1) ) Good Luck! Charlie [EMAIL PROTECTED]/Shield/Michigan From: Mark Marshall Date: December 10 2003 6:01pm Subject: SQL Statement Help - Is this possible? I have a database table that has one

SQL Statement Help - Is this possible?

2003-12-10 Thread Mark Marshall
I have a database table that has one row entered every day by the user. If the user skips a day, it throws off our monthly totals. Assume a table with four columns: id (which is the key), date (-mm-dd), data1 (int), data2 (int) Is there a way to say Select the first missing date in the

newbie sql statement help

2003-02-11 Thread Bob Ramsey
The people who run our mysql server are using version 3.23.51, so I don't have access to some of version 4's features like sub selectes. I have a table with data like this: firm firm_rank time time_rank student A 1 10 1 jones A 1 10 1 smith A 1 10 1 alvin A 2 10 1 bob A 2 10 2 charlie

re: newbie sql statement help

2003-02-11 Thread The Mindflayer
This might help. http://www.mysql.com/doc/en/example-Maximum-column-group-row.html I had the same problem. Before I found the webpage above, I went with a less efficient but simpler way. I wanted the highest revision (revision) for each news article (id). $SQL = CREATE TEMPORARY TABLE

SELECT statement help

2002-09-21 Thread Des Dougan
I want to extract data into a temporary table such that unique records with the same primary key (in this case an invoice number) are written to one record, with each of the unique fields extracted being written to a separate field in the temporary table record. I have created my temporary

Re: SELECT statement help

2002-09-21 Thread Paul DuBois
At 21:21 -0700 9/21/02, Des Dougan wrote: I want to extract data into a temporary table such that unique records with the same primary key (in this case an invoice number) are written to one record, with each of the unique fields extracted being written to a separate field in the temporary

Select statement help...

2002-01-12 Thread Tom Jones
Hello, I've been trying to figure this out but I feel like I'm just banging my head on the wall. I hope this is the right forum to pose this question. I have a table of flights which has several fields Table: flights Fields: depart, depart_time, arrive, arrive_time, flight_no, flight_group

RE: Select statement help...

2002-01-12 Thread Carsten H. Pedersen
Hello, I've been trying to figure this out but I feel like I'm just banging my head on the wall. That must be quite painful... I hope this is the right forum to pose this question. It's certainly one of the better ones, yes. I have a table of flights which has several fields Table:

Re: Select statement help...

2002-01-12 Thread Neil Zanella
On Sat, 12 Jan 2002, Tom Jones wrote: Table: flights Fields: depart, depart_time, arrive, arrive_time, flight_no, flight_group I'm trying to do a search on depart and arrive and show only the records which have matching flight_group SELECT depart, arrive FROM flights WHERE flight_group

Random Select Statement - help please

2002-01-09 Thread David V. Edelstein
Hi Roger, Thanks for your reply and I apologize for my lack of specificity on my previous email, thanks for your patience :). I have a people object that has 4 entities. name, pword, user_id, picurl This data is stored in the people table. Each user is identified by a unique user_id. I would

RE: Random Select Statement - help please

2002-01-09 Thread Roger Baklund
* David V. Edelstein I would like to create a mySQL query that will find the max user_id, use this value to calculate a random value of the user_id from [1 thru max], then return the entire row for that person(user_id) filled in with that persons(row) four entities, which I can use to

RE: Random Select Statement - help please

2002-01-09 Thread Rick Emery
Easier method: SELECT * FROM people ORDER BY RAND() LIMIT 1; -Original Message- From: David V. Edelstein [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 1:08 PM To: 'Roger Baklund' Cc: '[EMAIL PROTECTED]' Subject: Random Select Statement - help please Hi Roger, Thanks