Skip to content Skip to sidebar Skip to footer
Showing posts from April, 2024

Sql Server Conditional Foreign Key

I have two tables in my SQL Server database, Foo and Bar. Table Foo is like so: +-------+ | Foo |… Read more Sql Server Conditional Foreign Key

Issues Connecting To Microsoft Sql From Php

I am building a website using PHP on Somee Server(somee.com) and Microsoft SQL. Now I have a proble… Read more Issues Connecting To Microsoft Sql From Php

Sqlalchemy: Avoid Query Filter If Searched Value Is None

Is there a one-liner to handle the following scenario: def queryByAttr(attr1,attr2=None): if attr… Read more Sqlalchemy: Avoid Query Filter If Searched Value Is None

How I Get Or To Sum(if()) Mysql

i have a problem. I need to find out, how to put OR in this order: SELECT ROUND(o.`total_products` … Read more How I Get Or To Sum(if()) Mysql

Search In Integer Array In Postgres

Is there any other way to search for a certain value in an integer[] column in Postgres? My current… Read more Search In Integer Array In Postgres

I Need A Row_number Over Partition To Achieve This In Sql Server

I have three columns PID, AppNo and ProcessedDate I need a query to update the AppNo in the format … Read more I Need A Row_number Over Partition To Achieve This In Sql Server

Order By In Thymeleaf

I need show this foreach by order Asc, how can I do it? Solution 1: This could be achieved with so… Read more Order By In Thymeleaf

Sqlite Case Sensitive Search With Collate Nocase Field

I have a database (which I cant change) that has a collate nocase field: name string collate no… Read more Sqlite Case Sensitive Search With Collate Nocase Field

How To Show Error In Powershell Step Called From Sql Server 2008 R2 Job?

I've been looking around online, but haven't found very much. As a matter of fact, the mo… Read more How To Show Error In Powershell Step Called From Sql Server 2008 R2 Job?

Sql Two Criteria From One Group-by

I have a table with some 'functionally duplicate' records - different IDs, but the 4 column… Read more Sql Two Criteria From One Group-by

Sql Server - Replacing Single Quotes And Using In

I am passing a comma-delimited list of values into a stored procedure. I need to execute a query to… Read more Sql Server - Replacing Single Quotes And Using In

Using Trigger To Update Table In Another Database

im using the following trigger to update the user table in another database in mysql 5.0.7 The crea… Read more Using Trigger To Update Table In Another Database

Remove Second Appearence Of A Substring From String In Sql Server

I need to remove the second appearance of a substring from the main string, IF both substrings are … Read more Remove Second Appearence Of A Substring From String In Sql Server

Sqlalchemy Best Way To Define __repr__ For Large Tables

I have a bunch of tables in SQLAlchemy that I want to define __repr__. The standard convention seem… Read more Sqlalchemy Best Way To Define __repr__ For Large Tables

Firebird - After Insert Or Update Trigger

I have a calculation in my DB need to update 'field1' for 'table1' after the update… Read more Firebird - After Insert Or Update Trigger

Copy-paste Issue In Sql Server Management Studio

I have a table in SQL Server 2008 and one of the column is called Query with nvarchar(MAX) data typ… Read more Copy-paste Issue In Sql Server Management Studio

Calculate Sum Of Price From 2 Table Sql Server

After asking about calculate the sum of the total price here and Its work but then went I add(SUM(… Read more Calculate Sum Of Price From 2 Table Sql Server

Delete Recursive Postgresql

I have a table upload_temp as it follows: CREATE TABLE upload_temp ( codigo serial PRIMARY KEY … Read more Delete Recursive Postgresql

Ms Sql - Different Execution Plan For Different Schemas?

MS SQL SERVER 2008 We have one stored procedure with the same parameters. We have two accounts wi… Read more Ms Sql - Different Execution Plan For Different Schemas?

Select Table Name As A Column In Bigquery

I have a table in BigQuery, say table1 I want to be able to write SELECT table1.table_name as Table… Read more Select Table Name As A Column In Bigquery

How To Put An Image Into Selected Postition And Store In Database

What i have is a page to upload images and save their path into database with priority of the image… Read more How To Put An Image Into Selected Postition And Store In Database

Sql - Left Join 2 Foreign Keys To 1 Primary Key

I have two tables, Games and Teams. What should my sql statement look like to make a list of games … Read more Sql - Left Join 2 Foreign Keys To 1 Primary Key

Retrieving Values From 3 Tables

I have three tables: Consumer which has fields cons_id_no, key_id bm_bill which has fields key_id,… Read more Retrieving Values From 3 Tables

Temp Table And Stored Proc Compilation

Beginner question but I believe there is lot of confusion still exists as this behavior changed be… Read more Temp Table And Stored Proc Compilation

Multiple Requests To Php Blocked By First Connection

OK this will probably be a lot of explanation for a small question, so here goes. I have a quiz sys… Read more Multiple Requests To Php Blocked By First Connection

Convert Seconds To Datetime In Sql Server

How to convert seconds to datetime? I try this, but results are not correct: CONVERT(datetime, DAT… Read more Convert Seconds To Datetime In Sql Server

Find Minimum Datetime While Using Fk In Two Different Tables

I have 2 tables: COURSE ------ Id Name TEST ------ Id CourseId (FK to `COURSE.ID`) DATETIME NUMBE… Read more Find Minimum Datetime While Using Fk In Two Different Tables

How Can I Expand Out A Row Into Multiple Row Result Set?

I have a table that I'm trying to break out each row into one or more rows based on the second … Read more How Can I Expand Out A Row Into Multiple Row Result Set?

How To Split Sql Query Result To Populate A Dropdownlist

The DataSet looks like this: Spec1 Spec2 … Read more How To Split Sql Query Result To Populate A Dropdownlist

There Was An Error Parsing The Query Sql Server Ce / Vs 2010 Local Database

I wrote an little app in C# to keep track of customers and jobs but I get an error 'There was… Read more There Was An Error Parsing The Query Sql Server Ce / Vs 2010 Local Database

Select Into A Temporary Table In Oracle

I am trying to do something like the following, select * into temp from (select * from student); I… Read more Select Into A Temporary Table In Oracle

Sqlalchemy Lookup Tables

Hi I have a table in 3NF form ftype_table = Table( 'FTYPE', Column('ftypeid'… Read more Sqlalchemy Lookup Tables

How To Use "stuff And 'for Xml Path'" To Unite Rows In Table

Please help me to get united rows and list of accounts separated by commas in table. I don't qu… Read more How To Use "stuff And 'for Xml Path'" To Unite Rows In Table

Multiple Clickable Items With Different Actions To Perform In Listfragment From Sqlite

I'm a beginner. I've a ListFragment where every element in the list contains three TextVie… Read more Multiple Clickable Items With Different Actions To Perform In Listfragment From Sqlite

Why Can't I Use Select ... For Update With Aggregate Functions?

I have an application where I find a sum() of a database column for a set of records and later use … Read more Why Can't I Use Select ... For Update With Aggregate Functions?

How To Select Records With Maximum Values In Two Columns?

It was hard to come up with an understandable title for this question. I'll try to explain with… Read more How To Select Records With Maximum Values In Two Columns?

Dynamic Pl/sql Query, How To Ignore Null Parameters?

I have a PL/SQL procedure with multiple parameters. When a webapp calls the procedure, if it's … Read more Dynamic Pl/sql Query, How To Ignore Null Parameters?

Select Rows Containing The Group-wise Maximum Of A Column

Say I've got a table named Item, which contains items with a price, set on a certain date. Item… Read more Select Rows Containing The Group-wise Maximum Of A Column

Insert Into Table.. Exec At Linked Server Does Not Work

This works, returning a resultset : exec ('select ''col'', count(1) from test.d… Read more Insert Into Table.. Exec At Linked Server Does Not Work

Create Geofence While Storing The Location To The Sqlite Database

I am developing windows mobile application. I want to create geofence when storing the location to … Read more Create Geofence While Storing The Location To The Sqlite Database

Datagridview Not Refreshing

I have a SQL table that looks similar to this: 1 | a | stuff... 2 | a | stuff... 3 | b | stuff... 4… Read more Datagridview Not Refreshing

Getting Error Running Ssis Package On Non-ssis Server

I'm working in SSDT 2012. I've created a DTSX package that I have deployed to a SQL Server… Read more Getting Error Running Ssis Package On Non-ssis Server

Concept Of Handling Sqlcommand In C#

I'm trying to select a list of users from the database and send email to each of every users ba… Read more Concept Of Handling Sqlcommand In C#

Python Open Microsoft Sql Server Mdf File

How can I open an Microsoft SQL Server MDF file in Python? Edit I've tried pyodbc.connect but t… Read more Python Open Microsoft Sql Server Mdf File

String Aggregation In Oracle 10g With Three Columns

This is a sample table data Date | Fruit | Number ----------------------- 1 | Apple | 1 … Read more String Aggregation In Oracle 10g With Three Columns

Sql Check One List Against Another

I'd appreciate any pointers on how in SQL to check whether elements in one list also appear in … Read more Sql Check One List Against Another

Grails Sql Queries

Imagine I have something like this: def example = { def temp = ConferenceUser.findAllByUser(User… Read more Grails Sql Queries

What Happens If An Android App, Which Creates Database, Is Then Uninstalled?

I developed and install an android application which create a sqlite database. If I uninstall this … Read more What Happens If An Android App, Which Creates Database, Is Then Uninstalled?

Mysql Create Columns From Rows

From this sort of table: | id | in | value | valueMax | | 1 | 1 | 10 | 25 | | 1 | 2 | … Read more Mysql Create Columns From Rows