I’m writing a R code which will pull data from a data frame using sql query. My function looks like formatData =function(compe1,compe2) { query=paste(“Select A.month as month,sales_comp1,salse_comp2 …
Group similar URLs
I am looking to fetch all requests to xmlrpc.php and wp-login.php and have them wildcarded in the statement. But this presents an issue, as it doesn’t output the data in only two rows for xmlrpc and …
How to do calculate recursive sum in SQL in configurable in Big Query
I have query problem, I’m using Google BigQuery (Just to give you context if it is different). I need two value which is Value_A and Value_B. Value_A is top X value, and Value_B is the rest of top X …
PL/SQL Replacing characters in a string using another table
I need to create function that replaces characters in a string to characters from another table. What I’m trying returns exactly the same string from the beginning. Table t_symbols is: +————–…
Extracting integer ID from URL in SQL
Given a url like https://xyz.abc.yahoo.com/issues/80483987/tasks/1 How can write a SQL query to replace/extract urls like this with their integer ID that is 80483987 Using REGEXP_REPLACE(mystr, r'[^…
T-SQL – Get customized row when it exists
We have a table where we keep rows with vanilla settings for products, and customized rows per product per customer as they see fit to override. When a customer does not override, the vanilla rows …
Coalesce with a conditional expression
The following query works when executed in SequelPro: SELECT * FROM friend_computer LEFT JOIN computer m ON computer_id = m.id LEFT JOIN computer_status ms ON m.id = ms.computer_id JOIN …
How can I convert the values in one column into headers of a new table?
I have a table with three columns, “Partnumber”, “Specifications” and “Value”, I need to create a table with all data as VARCHAR in which each value in the column “Specifications” appears as Header. …
How to merge two rows in one if there is one same value in a column and change columns name
I’ve this query SELECT pm.post_id, pm.meta_key, pm.meta_value FROM birr_postmeta as pm, birr_posts as p WHERE pm.meta_key IN (‘ratings_average’, ‘ratings_users’) AND pm….
ERROR 1109 (42S02): Unknown table in MULTI DELETE
I use a temporary table t with these queries in order to delete duplicated rows from comment table: CREATE TABLE t ( id INT NOT NULL, hash BINARY(20), PRIMARY KEY(id), INDEX(…