Skip to content
Advertisement

Tag: database

Create a new double-field based on the existing string-filed

There is an SQL query forming a table. It is necessary to form another double-number field based on one of the string fields in the table. Values of the original string field (BRLOADSTA0): Values of the resulting double-field (BRLOADSTA9): The request which I’ve create: Full snippet: Thanks in advance even for trying to help 🙂 Answer Could you tell us

Update query with join and where clause

I’m currently confused with a (fairly easy) update statement that I’m trying to execute on a table. The two tables are as such: Customer table has the columns Loan table has the columns I would like to update the passworddisabled attribute to true if they are registered via a specific cash register. I’ve made use of the distinct command because

Simplifying SQL query

I’m using the Bixi public dataset found at https://www.bixi.com/en/open-data and have been asked to find “the average number of trips a day for each year-month combination in the dataset”. Here’s an example of the table from which I’m querying: id start_date start_station_code end_date end_station_code duration_sec is_member 85843 2016-04-15 00:00:00 6315 2016-04-15 00:05:00 6315 349 1 85844 2016-04-15 17:16:00 6315 2016-04-15

Sybase select value from XML field

I have a table named data_values stored in SYBASE in the following format: The value field has the following XML format: I want to select from the value field values like value1, value2, etc. but I can’t find a correct query to do this. I have tried: also value is a reserved keyword I think and I need to escape

Error Code: 1242. Subquery returns more than 1 row in Attribute Subquery

I’m trying to get the difference between two dates deathtime and admittime using subquery in attribute list. This is the script that I run: It returns Error Code: 1242. Subquery returns more than 1 row when I run it. Would really appreciate any help. Answer The reason why you’re getting that error is because a subquery can’t return more than

SQL Trigger for updating values from a query by id

I have three tables: employee with id(employee id), numOfTickets tickets with date, asset(id) and some more fields control with id(employee id), asset(id) when a new ticket is created it automatically inserts a row into tickets and control. Now I want to create a Trigger or something similar to automatically update the number of open tickets for each employee. A Query

Advertisement