How can I write an SQL Server query to trim all lowercase characters that comes before the first uppercase character in a string? e.g. string value “eaplgCostPrice”, remove “eaplg” and pass “CostPrice”…
Split column in hive
I am new to Hive and Hadoop framework. I am trying to write a hive query to split the column delimited by a pipe ‘|’ character. Then I want to group up the 2 adjacent values and separate them into …
SQL: How to determine the most frequent data length in the DB column?
Need to analyze values’ length in DB column and get the % of the Number of the values with the same length. Desire result: Same length values in COL1 = 70% with LENGTH = 10 chars It’s …
Generate unique Identifier for table
I’m trying to create a table in SQL Server. I want to generate a unique identifier 32 bit and be the primary key. I define it as primary key and set the type – how I can turn on the generation? How I …
Select rows where field is maximum, relative to another field
I have data in the following format: ID – Value a – 1 a – 2 a – 3 a – 4 b – 1 b – 2 b – 3 c – 1 c – 2 d – 4 And I would like to select rows with the maximum value for each ID, so that the output would be:
SQL: Nested Select vs Double JOIN by Performance
I have report based on a stored procedures and I need to add User name into output. In my system TWO users can be owners of transaction. Also, in my system User information stored in different …
MySQL to select max value between on and off time stamps plus 3 seconds
There’s a transporter inlet valve sensor which data is collected to a MySQL DB table showing the intake valve open and close cycles with the time stamps. There’s also a live weight sensor which data …
Returning a number when result set is null
Each lot object contains a corresponding list of work orders. These work orders have tasks assigned to them which are structured by the task set on the lots parent (the phase). I am trying to get …
My Left Join Query in mySql gives duplicate results even after using DISTINCT?
I have tried many solutions to get rid of Duplicate results in Query but no use. Here are my tables: sparepartorderdetails d table: id —– SparePartID ——–OrderID ——– Qty —– Price 101-…
PHP – show category once per group
Categories, whilst only displaying the category title once. I have one table that holds the category title (the parent) and the second table which holds the sub-category information. Although when …