SQL: SQL Exclusive Or

SQL
I have a table in the form: username | role ---------+------ name1 | internal name1 | admin name2 | internal name3 | admin name4 | ext...
1 year ago

SQL Query - Microsoft SQL

SQL
I have something like this: USERS (ID, name); SESSIONS (ID, userID, date) Now, I need to get all users which have at least 3 sessions and at least ...
1 year ago

sql, function in sql

MySQL
DELIMITER $ CREATE FUNCTION MAXSCOREID(START_STUDENT_ID INT, END_STUDENT_ID INT) RETURNS INT BEGIN DECLARE STUDENT_ID INT; BEGIN SELECT MAX(SCORE)...
1 month ago

Delete query won't work

SQL
I'm trying to remove a row from the database that has the same ART as is selected in the combobox. I had it working before but when I changed the data...
1 year ago

Limit listagg function to first 4000 characters

SQL
I have a query that uses the listagg function to get all rows as a comma delimited string to ultimately be shipped to a big text box. I'm getting the ...
1 year ago

How to get unique result with left join

SQL
i have two tables 1) Users and 2) Images. Users table id name 1 xyz 2 abc Images table id path 1 ~/img/12.jpg 1 ~/img/34.jpg...
1 year ago

Change Schema Name Of Table In SQL

SQL
I want to change schema name of table Employees in Database. In the current table Employees database schema name is dbo I want to change it to exe. Ho...
1 year ago

mysql while loop Break equivalent

SQL
What would be an equivalent of a break in a while loop for mysql? WHILE (ctr < i) DO ...... SET cnt = (SELECT COUNT(*) FROM temp_results ...
1 year ago

Use 1 junction table with 3 foreign keys Or 2 junction tables with shared sequencing?

SQL
I have 3 tables that I am trying to properly create relationships between: game phase game event (a step in a 'game phase') action window (a radical...
1 year ago

Unable to drop constraint in sql server 2005 "Could not drop constraint. See previous errors"

SQL
I'm trying to drop a constraint on a db table, something like: ALTER TABLE MyTable drop CONSTRAINT FK_MyTable_AnotherTable But the execution just r...
1 year ago

Select * as well as count/sum from another table

SQL
I am trying to write a MySQL query to select all rows from table a, as well as information from table b, while also querying the count and sum of valu...
1 year ago

Relate 2 tables in database

SQL
I have 2 tables in a database. One is for product data, and the other is for the images of the products. I have to set up an slider in the index of my...
1 year ago

how to sum all of rows in each row

SQL
I have this MySQL table: And when I use this query: SELECT emp_name, position, absent, sum(absent), ((absent*100)/sum(absent)) AS 'percentage' FRO...
1 year ago

Only taking 1 entry from the other table

SQL
I have 2 Tables that need to be joined, to illustrate here are my tables: Table baby |id|name |action_id| |1 |John |1 | |2 |Jane ...
1 year ago

How should I filter date in MySQL

SQL
I have to filter some row by date from one web page to another : This is the first page <?php while($row = mysql_fetch_array($result)){ ?> ...
1 year ago

Parsing data and inserting values into mysql database using php?

SQL
Php code to check if json data is coming from the android code. <?php require "init.php"; if($_POST){ print_r($_POST); }else{ echo "Nothing ...
1 year ago

how to insert date into database using jsp?

SQL
I'm trying to insert date into the database with a query that I do in java, but I get this error java.sql.SQLException: ORA-03115: unsupported ...
1 year ago

listing rooms available[hotel reservation]

SQL
In the not in query it is still returning the roomname with cancelled status but when I removed the query for trapping of dates the status !='cancelle...
1 year ago

How to use two pivot

SQL
I have 3 Tables: 1) user id name 1 abc 1 abc 2 tyu 2 tyu 2) phone id number 1 0987654 1 08907...
1 year ago

Search data using Timestamp datatype in Oracle Where clause

SQL
I have table Alert_Logs in which there are 2 columns KPI_DEF_ID and TIMESTAMP. The TIMESTAMP column is of timestamp datatype. I want to search a data ...
1 year ago