OUTING_ID TOUR_ID OUTING_START GUIDE 21000167 100345 30-APR-21 982354 21000168 100345 16-MAY-21 982354 21000170 100348 17-JUN-21 183476 21000200 100411 21-MAY-21 982354 21000202 100411 03-JUN-21 183476 21000205 100419 21-MAY-21 982354 21000207 100437 07-MAY-21 208655 Above define table describe the data of ou…
Tag: sql
Is creating a new table for each `list` the best way to speed up database queries here?
My postgres database has a lists and list_items table. There is an index on the list_id column. To list all items in a list, I have been searching through list_items for where the list_id equals id from the lists table. lists: id title 0 “foo” 1 “bar” list_items: id content list_id 0 &…
Why concatenation does not work in Dbeaver?
Using Dbeaver, the || concatenation does not work. Had to use CONCAT() instead. Got output error message: Truncated incorrect DOUBLE value. Anyone else had this issue? Skill level: Beginner Editor: Dbeaver OS: Windows 7 Answer MariaDB expects the PIPES_AS_CONCAT to be set with the sql_mode to use || as a conc…
How to delete rows that have duplicate column combination
I need to delete some rows that have the same column combination (except ID). The row that should be kept is the one that has the maximum reference date So, after the query the table should be like this I know that the query below will return the table I want, but I don’t know how to delete the “d…
Join same two tables multiple times in one query [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month. Improve this question I have problem with my query and i can not figure it how to do it. What i want to do is to di…
filter stop words from text column – spark SQL
I’m using spark SQL and have a data frame with user IDs & reviews of products. I need to filter stop words from the reviews, and I have a text file with stop words to filter. I managed to split the reviews to lists of strings, but don’t know how to filter. this is what I tried to do: thanks!
SQL Where statement for strings
I have a column that’s string and I would like to use a WHERE statement for all strings that begin with the “sea_” Any ideas on how to achieve that will be appreciated. Thanks in advance Answer It’s not clear what exactly your where clause should do. If necessary, you should please add…
Load Data into Datagridview Combobox
I have 2 field First “Name” and second “NIC” the “Name” Is text field and “NIC” Is combobox field. My query is i want to load data which is already save into SQL and i want to load it again on my grid how i can do that LIKE the below is my sql result name nic FT…
How to update USING sum and subquery
I have a SQL Server table similar to this: InkitemNo CapacityUnit NewInk OldInk ReturnInk ProdQty Description UsedInk 204 Machine1 5 2 0 4000 Next ? 223 machine2 4 3 1 8000 NULL ? 204 Machine2 0 0 0 5000 Next ? 224 Machine2 4 0 2 3000 Next ? I’m trying to write a query with this formula: Example to
keep only parent and corresponding child rows linked by parent case ID
I have a table of cases where child cases are linked to parent cases by a parent_case_id field that holds the case_id of the parent case. Cases with null parent_case_id are parent cases or cases that do not have child cases. I would like to remove cases from this table that do not have child cases and keep on…