Displaying 2 results from an estimated 2 matches for "my_row".
2009 May 25
3
Interpolating variables within (RODBC library) SQL statements for MySQL
...for German ZIP Code <--> Gauss-Krueger
Coordinate System ) and want this to be selected and computed individually
row by row as follows:
library(RODBC)
channel <- odbcConnect("database")
pos_to_zip <- sqlQuery(channel, "select YPOS, XPOS FROM
POSITION_to_ZIPCODE;")
my_row <- pos_to_zip[1,] # get the first element (change with next
ones afterwards)
ypos <-my_row[1] # get the first y-position xpos <-my_row[2] #
get the first X-Position
So far, so good: SQL Select works and everybody is fine, but this was just
the preparation for the next...
2007 Mar 16
0
find() and SQL functions
...complex SQL request to perform. I don''t want to manually do the
whole query (find_by_sql) because of the complex joins, but I want to
use MySQL functions, such as:
Model.find(:all,
:include => [../..],
:conditions => ["(../..) AND YEAR(STR_TO_DATE(my_table.my_row,''%Y-%m-%d %H:%i:%s'')) = #{year})"],
:select => [../..])
or
Model.find(:all,
:include => [../..],
:conditions => ["(../..) AND YEAR(STR_TO_DATE(my_table.my_row,GET_FORMAT(DATETIME,''ISO''))) = #{year})"],...