Having a difficult time putting what I am trying to do into words so searching is also difficult. Basically I am trying to look whether a certain value exists in a column, partitioned by group, and then propagate that value forward. In this example I want to check whether a user has completed the tutorial and…
Tag: sql
Class.forName(JDBC_DRIVER) no longer needed?
I’ve read here on SO that since java 6 you no longer need to register JDBC Driver using: Class.forName(JDBC_DRIVER); because DriverManager uses the path located in system property “jdbc.drivers” …
Access Query – [col]/[col].[col]?
Just inherited an Access database and trying to figure some things out. For the life of me, I have no idea what this query means. Its like the [col1]/[col2] is the table name and [col3] is the column. But instead of a table, it is math function (dividing two columns) followed by the column name. SELECT table.…
Convert Hibernate @Formula to JOOQ field
I am rewriting entire DB access layer from Hibernate to JOOQ and I face following issue. One of JPA models is annotated with @Formula annotation as follows: Later in the code, a JPA query is made against the database which compares fee5 to parameter: How can above query be translated to JOOQ DSL? Answer I man…
using sql – Is not null in a select statement
I can’t seem to figure out how to use the opposite of isnull or ifnull statements in sql. I need to say if a.Error1 is not null — then print the ‘ – ‘ and the + CHAR(13)+CHAR(10). Basically There should be no dash or no new line break if the a.Error1 comes back null. So print the…
How to declare sql variable in C#
My requirement is to remove all record but one from a table. For this I am executing a series of two different sql commands. Seems like on ssms it works fine but with C# is not –This is what I run …
ODBC error – SQL0104 – Token = was not vaild. Valid tokens: ( + – ? : DAY INF NAN RID ROW – Crystal report error in windows 7 machine
Our client have been using several crystal reports for many years in the windows XP machines and I am responsible for supporting these reports. It was working perfectly fine. Recently we have upgraded to windows 7 machine and one of the crystal report stopped functioning wherheas other crystal reports works c…
Split given string and prepare case statement
Table: table_name Insertion of records: Now I want to update set_name for some dates. For example: I want to update table like this: Note: The given_dates and set_name are pass a parameter because of they are dynamic. I may pass 2 sets as shown above s1,s2 or may pass 4 sets according to the requirement. So I…
Why does orderBy in F# not result in an ORDER BY in SQL?
I’m currently working on a small project that uses USA county data. I have no problems ordering the data in a Seq.orderBy, but as there is a sortBy in the query expression I would expect the results to be sorted. This is not the case. Now, the above is what I’m executing, but my results end up loo…
Using MAX within INNER JOIN – SQL
I have two tables, one called facebook_posts and the other called facebook_post_metrics. facebook_posts looks like facebook_post_metrics looks like So the common column that would be used for the inner join is id from the facebook_posts table and FBID from the facebook_post_metrics. So after the inner Join, t…