select initcap('PANJIM OPP BEACH RESORT CAMPAL TISWADI GOA')
output:="Panjim Opp Beach Resort Campal Tiswadi Goa"
Wednesday, August 25, 2010
Saturday, August 21, 2010
Insert data from table of one schema to another.
INSERT INTO cynosure.angles SELECT * FROM angles WHERE city ilike 'KDMC'
When the schema is public there is noneed to specify it i.e. there is no need to do schemaname.tablename
When the schema is public there is noneed to specify it i.e. there is no need to do schemaname.tablename
Thursday, August 19, 2010
Check Table Is Present in SCHEMA or not
$table="poinavigation_".$city;
$tableExistQuery="SELECT relname FROM pg_class
WHERE relname ilike '".$table."'";
$result=@pg_query($connectionTo38,$tableExistQuery);
$istableExist=pg_num_rows($result);
if($istableExist)
{
while($row = pg_fetch_Array($result))
{
$table=$row['relname'];
}
}
else
$table="poinavigation";
Wednesday, August 11, 2010
Thursday, August 5, 2010
Tuesday, August 3, 2010
postgresql-ARRAY
expression operator ANY (array expression) expression operator SOME (array expression)
The right-hand side is a parenthesized expression, which must yield an array value. The left-hand expression is evaluated and compared to each element of the array using the given operator, which must yield a Boolean result. The result ofANYis “true” if any true result is obtained. The result is “false” if no true result is found (including the special case where the array has zero elements).If the array expression yields a null array, the result ofANYwill be null. If the left-hand expression yields null, the result ofANYis ordinarily null (though a non-strict comparison operator could possibly yield a different result). Also, if the right-hand array contains any null elements and no true comparison result is obtained, the result ofANYwill be null, not false (again, assuming a strict comparison operator). This is in accordance with SQL's normal rules for Boolean combinations of null values.
SOMEis a synonym forANY.
Subscribe to:
Posts (Atom)