I want to remove the duplicated values from the columns ” 1)LabelName, 2)OpenLabelStandard, 3)Type “. The issue is that my table has four columns. beside to the three previous columns I have another one called 4)’Distance’. it is not a field from database. I added it to my table using …
Tag: sql
postgresql – condition met in a time interval
I have the following table and I want to create the condition_met column. The condition_met column is my expected output. Condition_met is TRUE when type_id = 34 and within 5 seconds after this type_id, the client_id of type_id = 34 becomes also prospect_id. To say it differently: for each type_id = 34 the cl…
SQL – Datatypes varchar and varchar are incompatible in the modulo operator [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed last month. Improve this question I have the following query that used to work but returns the error add…
How to add or insert foreign key value in child table from parent table using insert statement
I want to use the primary key of parent table in my child tables. I have created a foreign key to connect QUESTION and ANSWER table with each other. below is code of my database: user table So, In USER table I have added a new value: Now in QUESTION table I want to add a new value and I
Find the number of employees working under a manager
I have three tables called branch,employee and manager structured like this I want to view the id of each manager and the count of the employees he has under his supervision like this I have made this so far that shows which branch each manager works on but i don’t know how to proceed with the counting.…
How to concatenate a conditional field and remove the same value
I am trying to create a column with a case statement, then concatenate the column. Here is an example code. Basically, the Action_with_no_date will display the concatenation of values in Action with ‘**’ string added to the values where Date is null for each ID After I did this, I found an edge ca…
Get monthly sum/agv/max of a measurement from timestream
I am storing measurements in Timestream with the following attributes (example): Let’s assume these metrics are written one per day. How do I have to query the data in order to get a monthly sum on the request count metric for a specific domain? In order to get a sum for the whole time range queried I c…
Does Pervasive Have a SQL Function for URL Encoding?
I’ve written a query that builds some URLs to an intranet site, but some of the URLs don’t work because they contain special characters that need to be URL encoded. I’m trying to avoid writing a script (outside of SQL) to do the URL encoding; I’d like the database to do URL-Encoding in…
Can’t do Multiple Left Joins SQL Select (ODBC)
When I run the following SQL select statement with two left joins: I get the following error message in Excel VBA: “Run-time error ‘5’: Invalid procedure call or argument” When I run that exact same SQL without the left joins, it works without issue. I know the first SQL statement abov…
how to create new table in mysql with date default value for current date?
I am trying the following code: How can I make a default value for the date column? try the now(), but it is not valid.. Answer You can use current_date