Re: question about SQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
Further to defining two columns you can use select statement to get the value in the format you want, eg.
select concat(characters,'-',numbers) from example ; 
here characters and numbers are the two columns
Hope this helps  
--
Regards,
Abhishek jain



----- Original Message ----
From: Ruben Nijveld <mail@xxxxxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Sent: Sunday, January 6, 2008 5:25:12 PM
Subject: Re:  question about SQL

Rasha Abdo wrote:
> Hi,
> how can i define data type of filed like this:
> 
> 3 characters and 6 auto increment numbers (example: "DLL - 123456")
> 
> thanks.
You cannot, you will have to use two columns. Furthermore, numbers
aren't of a certain length. You might want to create the two colums like
this:

CREATE TABLE example (
characters CHAR(3) NOT NULL,
number INT(10) NOT NULL auto_increment
);

~ Ruben





      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping

[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux