I have the value of 58.3308% in the table(include % character), I need output of 0.583308, and the SQL query as below works fine in SQL console But I get this error in my python code, it’s a hive/impala problem, right? AnalysisException: No matching function with signature: rtrim(VARCHAR(40), STRING) Th…
Getting Duplicate column name ‘Unknown’ error when executing insert statement , mysql
Created a new DB schema / tables and tried to insert values. My insert query as follows INSERT INTO `arms`.`lobalarmpriorities`(`id`,`alarmpriority`,`description`) SELECT * FROM (SELECT 0,’Unknown’, ‘…
Oracle SQL String Contains a value from another Table
I am looking to find a way to add a where clause where a string in one table contains data from a column in another table. Select ID, Name, Group, List From EDG Where List Like ‘% (Select(Column X) …
How to find substrings in SQL (Postgres)
Let’s say I have a column called ‘code’ in my database table containing string data types. I want a query that will return all rows with a ‘code’ value that is a substring of a given search string, …
How to list the most expensive and the cheapest item in each category in Oracle SQL?
So I need to get a list of categories and then get the most expensive item and then the cheapest item out of each category. Then I need to sort these categories by the sum of min and max price in ASC order. I’ve tried this: Now this partially works. It does give me a list of categories ordered, it
How to SELECT DISTINCT *
Is this a possible query? Currently, every product from my database is being listed on the home page of my website and a lot of them are duplicates since a product can belong to multiple categories. I am using “SELECT * FROM Books WHERE product_status = ‘1’”; Answer Then use group by a…
SUBSTRING / CHARINDEX ADVICE
I have the following field in my database: | FileName | +——————+ | 4_20191118113041 | What I am trying to achieve is just return the 4, so anything before the underscore _. That …
Casting Date type to only display time
In my database(an Oracle 11 database) I have a attribute which is of Date type but has a time in the value for some reason, idk why it is Date type and not DateTime. When I select this ” Position_time”…
How can i duplicate records with T-SQL and keep track of the progressive number?
How can I duplicate the records of table1 and store them in table2 along with the progressive number calculated from startnum and endnum? Thanks the first row must be duplicated in 4 records i.e num: …
Getting ratios in mysql without subqueries
I would like to run a query from the tables below that gives me the ratio of the amount paid from the executive offices to the total amount due: CREATE TABLE offices ( name VARCHAR(255), ID …