-2
我想通过一个脚本,是在MySQL到PostgreSQL,但在mysql中产生的问题我一句这样的:参考月份和年份PostgreSQL中
$q1="select * from noticias where month(fecha)='".$elmes."' and year(fecha)='".$elanio."'";
我得到以下错误:
Warning: pg_query(): Query failed: ERROR: no existe la funcion month(date) LINE 1: select * from noticias where month(fecha)='03' and year(fech...^HINT: Ninguna funcion coincide en el nombre y tipos de argumentos. Puede ser necesario agregar conversion explicita de tipos. in C:\xampp\htdocs\calendario\index.php on line 131
你如何看待PostgreSQL的月份和年份?
你能用英文分享表格结构和错误信息吗?谢谢 –
你应该可以使用date_part:http://www.postgresql.org/docs/9.1/static/functions-datetime.html – purpleninja
$ q1 =“select * from noticias where date_part(month)(fecha)=' “。$ elmes。”'和date_part(year)(fecha)='“。$ elanio。”'“; ??????????? – Camaliet