I’m trying to write a query that will have a column show a specific value depending on another comma delimited column. The codes are meant to denote Regular time/overtime/doubletime/ etc. and they come from the previously mentioned comma delimited column. In the original view, there are columns for each of the different hours accrued separately. For the purposes of this,
Tag: sql
How does postgresql’s crypt() function know that a password matches a stored one?
I am learning to use crypt() function from pgcrypto to crypt my passwords and store them into user tables. However I don’t understand how it is possible for the crypt function to generate the same password if we pass as a second parameter the existing password. I want to understand how it does it please. In the exemple above if
Cascading combo box
I am trying to bind 2 combo box, being the value of the second dependent from de first. All the solutions that i saw to this problem were by the use of Sql.Data (Datatable), which i cant use, due to the architecture of the application. I can do it 2 ways, by c# or through ASP Object Data Source. I’ve
What will be the output of the left join? [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 8 months ago. Improve this question I have 2 tables A and B. Table A has 3 rows and
Subqueries in MySQL
My first post here and I am desperate. Need this to complete the last 2 questions of my assignment. This is the code I wrote and it is outputting almost what I need. The problem in the assignment wants to display Employees or Guests that are from Winnipeg or London. My code gives me all the cities for each employee
Oracle SQL Select: getting duplicate results joining tables
I’m starting with SQL and doing some exercises and I’m completely stuck on the last one. It is about looking for streets in the same country name. Two tables are used, locations and countries from the HR schema. The problem is that I don’t know how to avoid duplicate results. For example if I have the street “x” in Canada
Access Bare Columns w/ Aggregate Function w/o adding to Group By
I have 2 tables in postgres. users auth0_id email 123-A a@a 123-B b@b 123-C c@c auth0_logs id date user_id client_name abc-1 021-10-16T00:18:41.381Z 123-A example_client abc-2 … 123-A example_client abc-3 … 123-B example_client abc-4 … 123-A example_client abc-5 … 123-B example_client abc-6 … 123-C example_client I am trying to get the last login information (a single row in the auth0_logs table
SQL relative percentage for each country
I have a table: maps_query like below: The question is to output the relative percentage of queries for maps_query for each country. Desired output is like below: I don’t quite understand what relative percentage is here but I assumed it’s asking to output (a country’s search_query counts/ all search_query for all countries)? Would something like the following work? Answer You
Getting ‘error: syntax error at or near…’ in Postgresql insert query
I’m fairly new at Postgresql and learning new things everyday. So I have this blog project where I want to use PostgreSQL as a db. But I’m kind of stuck at the most basic insert query which is throwing an error. I have three tables, posts, authors and categories. I could create the table properly I guess but when I
SQL duplicates despite grouping on all key variables?
I am new to SQL and use it for work, so I am going to censor the real names of columns going forward in the query below. I am writing a query where the necessary data is spread across 3 tables. I have a network with users who send and receive packages from different nodes, and I want to see