Currency

2003-10-02 Thread Fabio Bernardo
I´m having some problems with currency´s fields. Actually I dont know what
mysql´s field typeI have to choose..^
I wanna input this value: U$32.00 but, when I write the query: Select
'field' from table it returns..
'32' and not 32.00.

Which select statement do i have to write?

thanks


dates difference

2003-09-19 Thread Fabio Bernardo
I´d like to write a mysql statemant which  takes two dates: 
for example:2003-11-10   2003-11-19
and results ...9 days

something like :select  2003-11-19  -  2003-11-10 

thanks




Round Question

2003-09-05 Thread Fabio Bernardo
I write this command:

Select round(1.1) 
and obtain 1 as answer
 Is there a round command to obtain 2 as answer. I mean, in Excel this
command  is knwon as RoundUp!

thanks a lot


curtime

2003-08-20 Thread Fabio Bernardo
When I write
select curtime();
It´s return the mysql´s system time, but I would like to change this time
(because it´s late 3 minutes)
Any ideas?
Thanks a lot


alter date

2003-08-06 Thread Fabio Bernardo
Hi there, 
Do you know a sql command which I can write to obtain the last date that I
updated a table 


date format

2003-07-01 Thread Fabio Bernardo
today´s date: 2003-07-01
Hi there,,,
I wrote down this statement
select (current_date - 1 )

and the result was:

(Currentdate -1)
---
20030700

when i write select (current_date )
I have:

(Currentdate)
---
2003-07-01

but actually, I wanna a result like that
select (current_date - 1 )

as result

(Currentdate -1)
---
2003-06-30

can you help me, please?



group by clause

2003-06-26 Thread Fabio Bernardo
hi there
I wrote this querie :
select  pop, prot, sw_or_local, sum(qtd_porta) as soma from clientes where
status'C' group by pop,prot,sw_or_local
And I have this result :

+++-++
| pop| prot   | sw_or_local | sum   |
+++-++
|BHE |   R2 |  local50
 | 
|BHE | R2 |  local   12
 |
+++-++
  .
 .
 .
 .
.
Have you see,? I would like something like that:
| pop| prot   | sw_or_local | sum   |
+++-++
|BHE |   R2 |  local62
Is my group by querie wrong...?


copying table

2003-06-18 Thread Fabio Bernardo
I tried to copy a table and got this mesagem, but I ´ve done this several
times ago... 

Got error -1 from table handler


left join

2003-06-12 Thread Fabio Bernardo
Hi there... I have this situation:

table_A  table_B
id name id   name
1   A  1 A 
2   B  2 B
3   C

If i run this statement :
SELECT table_A.* FROM table_A outer join table_B ON table_A.id=table_B.id
WHERE table_B.id is null
and I got:
id   name
3C

But now i wanna use i join which i dont know, to results:
idname
1  A
2  B

I mean the rows which are exactly the same is there a fast type of join
to make it? 


left join

2003-06-11 Thread Fabio Bernardo
Which mysql´s version is able to make sub selects statament???
And left join? could you there give me some left join examples???
thanks a lot


Select between different hosts

2003-06-10 Thread Fabio Bernardo
Hi there, Anyone knows if is possible to make a Select command between 2
tables located in differents computers.. I wanna only one statament
I mean..
I have the host named A, database dbA and table tbl_A...
and I have the host named D, databse dbB and table tbl_B...

I would like to write a comand like that:
Select * from dbA.tbl_A, dbB.tbl_B where dbA.tbl_A.field=dbB.tbl_B.field
thanks a lot


empty a table

2003-06-10 Thread Fabio Bernardo
Hi there, Im a new user
Whats the statemant to empty a table... I mean
I dont wanna delete one or two rows ...and not drop the table, i just wanna
empty it... i tried something like: empty table, but it didnt work...
thanks a lot


database copy

2003-06-04 Thread Fabio Bernardo
Hi there, I ´m using the Mysql control center with  a database called dbONE
in a PC, and I would like to copy it to another PC, Do you have any idea to
how can I do it? I dont wanna create all the tables again...
Thanks a lot 


control center question

2003-06-03 Thread Fabio Bernardo
Hi there, I´m  using control center 0.9.1-beta and when I started it, and
write a sql command with a database already selected(green color), I always
need to write first, the name of database which i´m using...
like that:

use dbteste;
select * from..

Is there possible to use a databse by default? I mean, without write the
command: use database;
thanks a lot