基本上,它是可能的,如果是這樣,你如何在CakePHP 2.0.6中不使用原始查詢()方法的情況下執行以下代碼。我正在使用PostgreSQL(其中generate_series()是一個函數)。那麼,你如何做這個查詢CakePHP的方式? $sql = "
SELECT new_rank FROM generate_series(1,999) AS new_rank
LEFT
聚集這是查詢我到目前爲止,創建每日酒吧: SELECT DISTINCT date_trunc('hour',t) AS date,
min(price) OVER w,
max(price) OVER w,
first_value(price) OVER w,
last_value(price) OVER w
FROM ticker
WINDOW w AS (PARTITION BY
在布魯斯Momjian的博客文章Generating Random Data Via SQL他用下面的代碼生成5個隨機字符串: SELECT
(
SELECT string_agg(x, '')
FROM (
SELECT chr(ascii('a') + floor(random() * 26)::integer)
FROM generate