sql - Sqldf: convert and select -


I am trying to read a SQL database in R (sqldf, postgresql), but there is some restriction on one column (Convert and choose). In the column I want to adjust, there are three possible elements (all wire), ie empty string, four numbers or four number one space and two characters after An example can be

  "2378", "", "432 9", "4193 AM", "2195"  

Are real numbers and between 1000 and 1200 (and instead of string types change int). The column name is "post" and it is that I have achieved so far

  query = "SELECT *, cast (posted as int) postConv base WHERE length (post) ) & Gt; 0 and length (post) <5 " 

The problem is I do not know how the selection is like the new converted number 1000 and 1200. For now, one Additional columns 'postcorn' will be created, but is it even possible that the converted elements are only stored in 'post'?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -