full error:
{ error: column "crop" does not exist in events
at Connection.parseE (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:554:11)
at Connection.parseMessage (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:381:17)
at Socket. (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:117:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at Socket.Readable.push (_stream_readable.js:130:10)
at TCP.onread (net.js:542:20)
my code:
var string = 'select created_at::date, name, count (*) from events where created_at::date > GETDATE()::date - 7 AND (name="crop" OR name="adclick") and origin="mako.co.il" group by created_at::date, name';
redshiftClient.query(string, null, function(error, answer){
if (error){
console.log(error);
}
else{
console.log(answer);
}
...
however when i use SQL worbrench:
jdbc:redshift://syte-dw.cwvze9ydsqd4.us-east-1.redshift.amazonaws.com:5439/analytics
with the same query:
select created_at::date, name, count (*)
from events
where created_at::date > GETDATE()::date - 7 AND (name='crop' OR name='adclick') and origin='mako.co.il'
group by created_at::date, name
found the problem:
my query nodejs query:AND (name="crop" OR name="adclick")
my SQL workbrench: (name='crop' OR name='adclick')
nubieeeeeeeeeeeeeeeeeee
full error: { error: column "crop" does not exist in events at Connection.parseE (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:554:11) at Connection.parseMessage (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:381:17) at Socket. (/Users/dang/Documents/applicaster/syteCMS/node_modules/pg/lib/connection.js:117:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at Socket.Readable.push (_stream_readable.js:130:10)
at TCP.onread (net.js:542:20)
my code: var string = 'select created_at::date, name, count (*) from events where created_at::date > GETDATE()::date - 7 AND (name="crop" OR name="adclick") and origin="mako.co.il" group by created_at::date, name'; redshiftClient.query(string, null, function(error, answer){ if (error){ console.log(error); } else{ console.log(answer); } ...
however when i use SQL worbrench: jdbc:redshift://syte-dw.cwvze9ydsqd4.us-east-1.redshift.amazonaws.com:5439/analytics
with the same query: select created_at::date, name, count (*) from events where created_at::date > GETDATE()::date - 7 AND (name='crop' OR name='adclick') and origin='mako.co.il' group by created_at::date, name
i get my results: 2016-12-07 adclick 16 2016-12-05 adclick 190 2016-12-06 adclick 192 2016-12-07 crop 474 2016-12-01 adclick 295 2016-12-02 adclick 154 2016-12-03 adclick 140 2016-12-05 crop 3688 2016-12-06 crop 3610 2016-12-01 crop 5362 2016-12-02 crop 3296 2016-12-03 crop 3087 2016-12-04 crop 5209 2016-12-04 adclick 229