Help with a join query

2006-02-22 Thread Yoed Anis
Hi all, I'm trying to do the following. I have three table: Table a has address information: address_id | City | State | Zip 1Austin TX 78758 2 Dallas TX 77000 3 Galveston TX 77550 Table b has information about the location: address_id | Location_id | Location_name 11The

Order by price?

2004-04-29 Thread Yoed Anis
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 column establishments is an int(10), as you see I am taking this number through a formula, and I want the result of this

RE: Order by price?

2004-04-29 Thread Yoed Anis
, Yoed -Original Message- From: Robert J Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 12:23 PM To: Yoed Anis; [EMAIL PROTECTED] Subject: Re: Order by price? Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA*(establishments^2)+$varB

RE: Order by price?

2004-04-29 Thread Yoed Anis
. Best, Yoed -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 12:28 PM To: Yoed Anis; [EMAIL PROTECTED] Subject: Re: Order by price? At 12:14 -0500 4/29/04, Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA

RE: SUM same field twice in one SELECT?

2004-04-27 Thread Yoed anis
Use if statements: Your query would then look like this: SELECT SUM(IF(cur = 'SEK',amount,0)), SUM(IF(cur = 'EUR',amount,0)) FROM table1 WHERE ... The if statement has three properties, the first is the condition, the second what to do if true, the third, is what to do if false. Hope this

RE: Is it possible to get a timestamp from the server ?

2004-04-24 Thread Yoed anis
Yea do a search on the mysql.com web site for date functions (or just click here http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html ) its loaded with many examples and descriptions of useful functions. Built in date calculations are one thing I really enjoy with mysql. Best, Yoed

Ram to Processor ratio

2004-04-22 Thread Yoed anis
Ok, Looks like I will be building my own server for my company. Its sole purpose will be to run mysql/php/apahce as fast as possible for under $2.5k I'm not using mysql for storage. I will be using it to return many complex queries in fewer seconds. Its speed over space. So far I've been able to

Selecting a Column

2004-03-23 Thread Yoed Anis
Hi, I have a table that looks like this: CREATE TABLE inventory ( inventoryid int(11) NOT NULL, sunday int(3), monday int(3), tuesday int(3), wednesday int(3), thursday int(3), friday int(3), saturday int(3), PRIMARY KEY (inventoryid) ); And I'm trying to run a command like SELECT

Search WHERE SUM

2003-07-28 Thread Yoed Anis
Hello, What would be the proper way of generating a query like the following; SELECT id FROM sales WHERE SUM( totalsales) = '2' GROUP BY id; Assuming the table looks like this; Sales: Id| totalsales| monthyear 1 | 100 | 2003-09 1 | 1 | 2003-08 1 | 2000| 2003-07 2 | 3

Interesting Problem

2002-01-09 Thread Yoed Anis
Hi... I have an interesting problem I don't know which way to solve. I tried posting this on the PHP site (since I'm coding with PHP and mysql) but they said I might want to try my odds here.. since they suggested I go with the mysql solution, but I'm clueless where to start. So I'll shoot it out