Skip to content
Advertisement

Tag: select

How to compare two columns in the CASE statement

I have two columns Speed_A and Speed_B. Now I will compare both columns and will select the higher one in a new table. Something like this: How does it work? Answer Assuming your speeds are numerically typed you might get this as easy as: Your ELSE will only occur, when A and B are equal, In this case it doesn’t

Spark SQL passing a variable

I have following Spark sql and I want to pass variable to it. How to do that? I tried following way. Answer You are almost there just missed s 🙂

how i can select records with varbinary type?

I have table in my database that has two column namely data and length. I declare data as a VARBINARY(MAX) and suppose the table has a record with length equal to 5 and data = 0x23 0x00 0x12 0x45 0x34. Table definition: The question: Is it possible to search (with a SELECT query) to find records that has 0x00 0x12

SQL: Two select statements in one query

I want to select information from two SQL tables within one query, the information is unrelated though, so no potential joints exist. An example could be the following setup. tblMadrid tblBarcelona I want to have a query that gives me the following: I tried to follow this logic: Multiple select statements in Single query but the following code did not

SQLite database – select the data between two dates?

I want to select my data by date – from a date until another date, so I have this query, But this query only return the data in ‘2014-10-09’, excluding the data in ‘2014-10-10’, unless I change the query to this below, This is not an ideal solution. How can I select the data including the data in ‘2014-10-10’? NOTE:

Advertisement