I have a database in which I store wind direction readings by degrees. I need to do two things really, i need to group all readings by 45 (basically 45 degrees between “N”, “NE”, “E”, “SE”, “S”,”SW”,”W” and “NW”) a…
What is the maximum value for STRING ordering in SQL (SQLite)?
I have a SQLite database and I want to order my results by ascending order of a String column (name). I want the null-valued rows to be last in ascending order. Moreover, I am doing some filtering on the same column (WHERE name>”previously obtained value”), which filters out the NULL-valued row…
I need to send id using select in html
I want to show name of the record in select, but I need to send only id of that record. My code: Answer You can send selected value in option
Split SQL string with specific string instead of separator?
I have table that looks like: I want to split the string to this: My goal is to show ID and all the strings starting with 1 with just the next number after them. I filtered all rows without ‘%1,%’ and I don’t know how to continue. Answer If you use SQL Server 2016+, you may try to use a
SELECT query without FROM clause with a million rows
I’m trying to generate a million rows for a database table using SQL. The logic for the columns is in place, but I’m not sure how to go about generating a large number of rows without having a FROM clause. I’m aware of how to write the SQL query without a FROM clause – select ‘a&…
Trouble with outer join coupled with search coupled with group by
I am trying to do 2 things with a query. 1) Return the ticket subject from one table and the matching messages from another table. This is a one to many relationship and I want the return to show the subject with all the messages for each subject concatenated. 2) be able to search against the subject as well …
SQL error syntax, please check the manual that corresponds to your MariaDB server version for the right syntax to use
I try to insert a new value into a table by using preparedStatement but I obtain a syntax error that I can’t solve. Java code : Error Code : I hope that you can help me thank you. Answer I see several potential problems here. First, you are passing the SQL string to executeUpdate(), which is incorrect. …
How the db model should be for this scenario? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I’m modeling a database scenario but I’m not understandin…
How to select the latest date for each group by number?
I’ve been stuck on this question for a while, and I was wondering if the community would be able to direct me in the right direction? I have some tag IDs that needs to be grouped, with exceptions (column: deleted) that need to be retained in the results. After which, for each grouped tag ID, I need to s…
Mysql Mariadb recursive query
I have the following table : and a recursive query on it : which works and prints the following result : I would have liked to add an extra column to the result, namely “parent_name”. How do I do this? Edited to add: https://stackoverflow.com/a/22376973/2027239 That was the answer on an older ques…