i have a column in table which contain data like XML,i would like to get data in rows. My table data as- select printDataColumn from Mytable It returns value-
Tag: sql
Failed to insert record and return id
I have a query that returns its id after adding DO $do$ BEGIN IF (SELECT COUNT(*) = 0 FROM COMMENTS WHERE PARENT_ID = ”${this.parent_id}’) THEN UPDATE …
Mysql query for comparing price one to each other based on type
example table name | source_data | price_a | ——————————— name A | site_a | 40.00 | name A | site_b | 50.00 | name B | site_a | 30.00 | name B | site_b …
time and date from nvachar
Want to convert NVarchar to Time and date using update column command in sql server CREATE TABLE [dbo].[timeconvert]( [sno] [int] NULL, [Duration_Load] [nvarchar](7) NULL, [Duration] [time](7) NULL, …
SQL query to Rails query (Case Statement)
This is my SQL query: SELECT user_id, CASE responsible WHEN 1 THEN “true” ELSE “false” END AS responsible FROM user_departments How do I write this in rails? I tried a query as below: …
Filter and keep most recent duplicate
Please help me with this one, I’m stuck and cant figure out how to write my Query. I’m working with SQL Server 2014. Table A (approx 65k ROWS) CEID = primary key CEID State Checksum 1 …
Select every rows that contains all elements of group
Column [TYPE] has A or B or C. I want to select list of names those have all A,B,C in the table. Result — dealing with count select name from tempso group by name having count(*) = (…
Running an insert script from multiple values
I’m trying to run a pretty simple script that does the following: Takes the id of a content module and assigns it to multiple locations So say I click the link on a content module with ID of 123, I …
Python inserts only One row on a SQLite DB
Why my code only inserts one line? thewholeenchilada = (“SELECT SUBSTR(email, (SELECT INSTR(email,’@’))) AS org, SUM(count) as count FROM Em GROUP BY org ORDER BY count DESC”) for salida in cur….
Filter data by multiple rows in second table MYSQL
I have 2 tables. users and users_meta. I want the query to return all users that have sexe=M and user_att1=1 (which should return only mathew) but I also need to be able to filter by other attributes …