I have a column in my database called: "CIElabOne" which is of the type numeric [] ("CIElabOne" numeric[]) and thus contains values like: {9.766934377517181,0.0011685082518947398,-0.0023119569625251746}
I cant access the values independently, when executing the following SQL query:
SELECT "fileName" FROM "clothItems" WHERE "CIElabOne[1]" = '9.766934377517181'
The result is : ERROR: column "CIElabOne[1]" does not exist
Selecting CIElabOne as a whole is not a problem but I need to evaluate each of the elements of the array. I don't know why this happens I am following the guide http://www.postgresql.org/docs/9.1/static/arrays.html but I don't seem to find the error
This is my real sql query in java:
sqlTwo = "SELECT \"fileName\" FROM \"clothItems\" WHERE \"CIElabOne[1]\" = '"
+ inputColorOneCIELAB[0]
+ "' AND \"CIElabOne[2]\" = '"
+ inputColorOneCIELAB[1]
+ "' AND \"CIElabOne[3]\" = '"
+ inputColorOneCIELAB[2]
+ "' and \"gender\" = '"
+ inputGender
+ "' AND \"shape\" <> '"
+ inputShape
+ "'";
inputColorOneCIELAB[] is an array of doubles
select filename from clothitems where cielabone[1] = ? and .... Use a prepared statement and pass parameters instead of using concatenation.