• Order table based on specific column count 2019-01-20

    I have a projects table with the following columns id, project_name, remix_of A project can be a remix of another project and the id of the project being remixed is stored in the remix_of column id | project_name | remix_of --------------------------

    Tags: mysql, sql, laravel
  • Having Joins query with limit 10 on second table 2019-01-19

    I have designer and design table designer has many designs I want to get all designers with 10 designs for each designer Is there way I can do it in a single query in either postgresql, mysql --------------Solutions------------- For best performance

    Tags: mysql, sql, postgresql
  • Dynamic Query Generation is not working with SQL 2019-01-15

    I am trying to execute following SQL statement : USE[Northwind] declare @MainQuery varchar(255), @WhereClause varchar(255) Select @WhereClause = 'where CustomerId =ALFKI' Select @MainQuery ='Select * from Customers '[email protected] execute(@MainQuery)

    Tags: sql, sql server
  • How to performance tune this query? 2019-01-14

    Need help in performance tuning the query. The execution plan shows the scan count is too high on SResourceHierarchy and grouprelationship tables around in millions. I created covering indexes on sresource and matrix goal that reduced the time majorl

    Tags: database, sql, sql server
  • Combine date ranges in a table 2019-01-13

    This question already has an answer here: How do I group on continuous ranges 5 answers I have the following table id price startdate enddate product 1 112 12/05/2015 12/05/2015 A 2 112 13/05/2015 13/05/2015 A 3 112 14/05/2015 14/05/2015 A 4 112 15/0

    Tags: sql, sql server
  • Testing Oracle DB table structure with Spring-Java 2019-01-09

    Im connecting to an external database wich im not able to populate with testdata to do a proper integration test suite for my DAO on. As an alternative I would like to test the structure of the tables. For example that the tables im using has columns

    Tags: database, sql, java, oracle, spring
  • How to return an value/null no matter the column value is exist or not 2019-01-05

    TABLES <<USER>> id name ------------ 1 alex 2 gary 3 peter 4 mary <<ITEMS>> id index items ----------------- 1 1 iphone 1 2 apple 2 1 nokia SQL SELECT u.id, u.name, i.items FROM USER u, ITEMS i WHERE u.id = item.id(+) AND (item.ind

    Tags: sql, oracle
  • Displaying Arabic script while converting from Access database 2018-12-30

    I have converted my database from Microsoft Access to SQL Server 2008 database. All the columns converted successfully. But the Arabic scripts in one column didn't display properly in SQL Server. It display Arabic script as Îáíå ßíæÝÊ ãÑÈÚå. Please h

    Tags: sql, sql server, ms access
  • How to include last updated row in RoR 2018-12-22

    So I have two models, Category and Topic and any category can have many topics. The question is, how do I query for all categories and include each category's last updated topic? If I do something like this class Category < ActiveRecord::Base has_man

    Tags: sql, ruby on rails, postgresql
  • Data integrity exception with hibernate 2018-12-22

    I created 300 records from backend with primary keys, So now when these primary key's are generating through hibernate then data integrity exception shows. Hilo algorithm is using to generate key's org.springframework.dao.DataIntegrityViolationExcept

    Tags: sql, postgresql, hibernate
  • Error message: Cannot delete or update a parent row: a foreign key constraint fails 2018-12-16

    When executing my doDelete.php, this error message appears: " Cannot delete or update a parent row: a foreign key constraint fails (fyp.book, CONSTRAINT book_user_key FOREIGN KEY (id) REFERENCES user (id) ON DELETE NO ACTION ON UPDATE NO ACTION) &quo

    Tags: mysql, sql, constraints
  • To select range of values between two columns 2018-12-04

    I have a table which has 4 columns and i want to get a value between two range of values in column .I tried but it returns null.Pls help me to over come the issue. GradeID | FAMin|FAMax| FAGrade| 1 | 37 | 40 | A1| SELECT * FROM GradeSystems WHERE FAM

    Tags: sql, sql server
  • Biggest/Longest records in varchar table 2018-11-20

    We recently noticed that in one of our biggest tables some of the rows are a few times bigger than others. By "bigger" I mean longer and taking more storage space. How to display top 1000 biggest rows in the table? Almost all columns are varchar

    Tags: sql, sql server, varchar, maxlength
  • Stored Procedure runs over one dataset, but hangs over the other 2018-11-18

    I have a stored procedure which pulls a large SQL blob from a table. That SQL blob returns tens of thousands of records and then the SP performs certain actions on those records (inserts into different tables) . Essentially, the blob looks something

    Tags: sql, sql server 2008
  • MySQL Group By query produces indeterminate results 2018-11-16

    I have a problem ... I have one request, but each time I'm refresh the request, the result changes. Here is my request SELECT `t`.*, COUNT('ID') AS `tr` FROM ( SELECT * FROM HISTORY WHERE USER_ID = 1 AND BIEN_ID IS NOT NULL ORDER BY CREATED_AT DESC)

    Tags: mysql, sql
  • Error in my SQL syntax on SQL Fiddle 2018-11-09

    I'm new to sql programming. For a computer science project I am trying to apply my knowledge of sql in some way. On SQL Fiddle, I am using the MySQL 5.6 database and I am having so much trouble building schema. This is what it keeps telling me: "You

    Tags: mysql, sql, sqlfiddle
  • 1 Working Day Back In SQL DB2 2018-11-09

    I need to select data from database with a date that is one day back into the past but on working day. Is there a specific function for that ( Excel has got formula =Workday)? I am downloading data from DB2 to excel with VBA instructions. Here is the

    Tags: sql, db2, vba
  • Sql: How to combine multiple rows into a string as an expression within an update 2018-11-08

    In sql (MS sql server specifically) is it possible to combine multiple rows into a single string as an expression which is itself part of an update that is being applied to multiple rows. I have come across the approaches of using COALESCE or FOR XML

    Tags: sql, sql server
  • Getting 0 rows returned on query 2018-11-06

    so let me start will the basic table layout for all tables involved: #zip_code_time_zone +----+----------+-----------+ | id | zip_code | time_zone | +----+----------+-----------+ | 1 | 00544 | -1 | | 2 | 00601 | -3 | | 3 | 00602 | 0 | | 4 | 00603 | -

    Tags: sql, sql server
  • using sql like in java 2018-11-05

    I make a procedure that get a nvarchar and it return a table by using like and it works well. but when I want to use this procedure in java it doesn't work. here is the java code. String query = "exec Predict ?"; pst = conn.prepareStatement(quer

    Tags: sql, java

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 3.068 (s). 9 q(s)