Re: adding a new record

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

 



make your column unique
[like for example;
ALTER TABLE `table_name` ADD `sample_column` VARCHAR( 10 ) NOT NULL ;
ALTER TABLE `table_name` ADD UNIQUE (`sample_column`);
]

so every time you insert and even if its the same data.. it won't insert
into your table unless it is unique...


> is there some way to construct an INSERT query such that it only adds the
> record if certain values don't already exist in the table? (not unlike
> SELECT DISTINCT). or do i have to make a seperate SELECT statement to
> check
> before adding?
>
> thanks,
> -jake
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux