Skip to content

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…

Is there any function in C# like isnull in SQL?

In SQL server we can use “isnull” function for example if Table1 Contains Field1 and only one record which Field1 is null we can write this Query: which returns “0”. can we use any function like this in C#? for Example Consider textBox1 is Empty. and I want to Show “0”. Ans…

SQL – Get result of current year only

How can I get the result of the current year using SQL? I have a table that has a column date with the format yyyy-mm-dd. Now, I want to do select query that only returns the current year result. The pseudo code should be like: The result should be as following: How can I do this? Answer Use YEAR() to