I need to get values a from client dynamically(using input function) and I need to pass that value to Oracle bind variable. I am using SQL queries. Answer Here’s an example: Running it gives:
Tag: sql
How to expand categories by id in SQL
I have the following table: I would like to have for each org_id, person_id, month a line for each category of consultation_mode and professional_domain, as per the below: There are 3 consultation_mode: in person, telephone, home visit & 3 professional_domain: doctor, nurse, other. How can I do this in SQ…
req.query returns nothing
Trying to get variable from http://localhost:3000/categories/subcategories?category_id=13 but req.query returns empty result. Is this possibly a problem with the way I’ve set up my server? Answer See how you are passing the data , directly entering the data or from another URL you are passing the data. …
How can I make TO_DATE in Amazon Redshift work with multiple date formats in the same column?
I have a string column with date-time values that I need to convert into dates in order to calculate a dense rank. This column can have any of the below 3 formats: My SQL Statement to calculate the dense rank is based on this date-time column that I need to convert to date in order to rank descending: However…
How calculate the max area from random point in a MYSQL table
I have a table with this data : x,y column 0 0,1 2,5 2,5 1,2 1 (they are random points) with this point how can i get the biggest area posible. Sample: select area(ST_GEOMFROMTEXT( ‘POLYGON( (0 0,1 3,5 3,5 1,3 1,0 0) )’ )) = 10 select area(ST_GEOMFROMTEXT( ‘POLYGON( (0 0,1 3,5 3,5 1,0 0) )&#…
MySQL query fails on syntax [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 4 m…
How do I change a text to an enum type?
so basically I want to import a csv file and one of the columns has the data yes/no in it and I have created an enum that has values ‘red’ and ‘white’ and the yes related to ‘red’ in the enum and no relates to ‘white’ in the enum and the column in the table in t…
Syntax error in SQL code being used in R, no row_number function found
I am using RSQLite, DBI, and dbplyr packages. I’m watching this YouTube video by TechTFQ. I’m getting a syntax error with this line. Error: near “row_number”: syntax error I’m certain that the SQL syntax I’m writing here is the same as what I’m watching in the YouTube…
How to fix Encoding error utf-8 – PostgreSQL
I am following instructions online to create a database in pgAdmin4. I have successfully imported a csv file and created a table. However, I cannot select anything from the table. My code is: SELECT * FROM transfers; Error message is: ‘utf-8’ codec can’t decode byte 0xc3 in position 0: unexp…
R using RSQLite, DBI and dbplyr, can’t have more than one table in the RSQLite in order to make a join
I’m having a hard time understanding the behavior of these three packages: RSQLite, DBI, and dbplyr. I’m using the mtcars dataframe and I’m loading it with the tibble package to add the car name as one of the rows. I also created my own table that has information about where all these cars w…