7,494 Archived Topics
Remove Filter ![]() | |
I need to add two different fields in two separate tables, but the second sum is double what it should be. Here's what I'm using: Select A.dc,A.rc,B.acctno, ((Sum(If(B.ttc In ('X','Y','Z'), 0, B.ua))) - (Sum(If(B.ttc In ('X','Y','Z'), B.ua, 0)))) As Total_UA, (Sum(C.cub)) As Total_CUB From Table_B As B Left Join Table_C … Databases mysql | |
Sum of One and not the Other I have a requirement to query one figure and the sum of another. What I need is one query to produce the MonthPayment for each CompanyID for a given ContractID and the Sum of TotalPayment with matching CompanyID and ParentCompanyID for each CompanyID … Databases mssql | |
Hi to all, i created following table in SQL. =================================== create table employee(name varchar(20), dob date) =================================== But, when i ran the query, i got the massage that 'SQL can not find data type 'date''. How should i include 'date' in to table definition. Databases mysql | |
Hi Guys, Can anybody spot the error on this code? it gives me error: SQL Server Database Error: Incorrect syntax near the keyword 'inner'. 5 0 [CODE]Select e.event_number,e.start_date ,event_desc, venue_desc,s.location from events e inner join venues v on v.venue=e.venue inner join sessions s on s.event_number=e.event_number and session_type='0' (inner join contact_categories … Databases mysql | |
Hi to all, I created following table =================================================== create table man(id integer, name varchar(20), city varchar(20), age integer, dept integer) =================================================== I want name and maximum age of person residing in 'mumbai'. I wrote following query, but got the error like 'can not include name with max() fuction since it … Databases mysql | |
hi, guys i have a problem here. i have a form which creates a new table for each new user and that user will have a monthly update of his salary now im confused how to go about this. do i need to create a new table or how to … | |
Hi Guys, I need some help. I don't understand how to do an alter table statement. I had a lab last week that used it and I couldn't get mine to work. [CODE]DROP TABLE ENROLLMENT CASCADE CONSTRAINTS PURGE; DROP TABLE COURSE_SECTION CASCADE CONSTRAINTS PURGE; DROP TABLE COURSE CASCADE CONSTRAINTS PURGE; … Databases oracle | |
Hi all, Firstly- I've written a PL/SQl procedure to what I'm asking about in this posting. However, I'd like to do it with a single(or nested) SQL selection statement (I don't think its possible, but I'm no expert and was interested to hear if anyone has a solution- or just … Databases oracle | |
Please send me the working link of 'free downloading oracle9i' and steps for downloading it. Thank you! Databases oracle | |
I am trying to implement a CSS hierarchical unfolding menu on a site. The thing is, it needs to be dynamically populated from the results of a database query. I previously had the menu working but then it was ‘hard coded’ and not built on the fly. Menu description: 2 … | |
hi, i have a client request which i am unsure how to achieve. i need to be able to search the mysql database for the closest post code to a person who enters in their post code. so for example a user types in post code nn1 1ne and the … Databases mysql | |
I need to record insert statements, who did them, and when. I am adding triggers to tables and putting the freshly inserted data into a sql_log table. Everything is working well except one thing. I want dates, times, and timestamps to be surrounded by quotes. Just like they would be … Databases mysql | |
Hi to all, table name: mail email name [email]abc@gmail.com[/email] abc [email]def@rediff.com[/email] def [email]pqr@yahoo.com[/email] PQR [email]xyz@daniweb.com[/email] XYZ ======================================= QUERY: List all email and names in lower letters without any blanks. ======================================== I ran ltrim(), rtrim() and lower() function on data successfully. But fail to retrieve this data. Will you please help … Databases oracle | |
Having trouble storing dollar amounts in the thousands due to the "," that gets inserted once the number becomes 1, 000.00. Any advise? Databases mysql | |
I am trying to write some queries and I am confused on exactly what to do. Here are my tables that reference my 3 questions. Branch ([U]branch_id[/U], branch_name, street_address, city, state, zipcode, phone, branch_manager, library_id) FK – library_id > library Library ([U]library_id[/U], library_name, street_address, city, state, zipcode, phone, manager_name) Patron … Databases sql | |
I was trying to solve this query: [B]Find all the students who have taken the course taken by a instructor named 'XXX'.[/B] Well the division operator of relational algebra can do it easily. I want to know how to use the division operator in sql(if there is any) or any … Databases oracle | |
Hello everyone! I've just started a module on Database Design & Implementation and was wondering if someone with experience of ERD's could take a quick look for me. Here is the scenario [QUOTE]Nightingale’s Nursery Nightingale’s is a private nursery organisation which takes in children from the age of one year … Databases database-design session | |
//Hi, //i create following table Table name : person ID AGE FNAME LNAME 1 10 Geek Greek 2 20 Seek Bells 3 30 Creek Dells 4 40 Sreek Sells[/B] // I wrote following procedure which is run successfully. Create or replace procedure proc1 as cursor person_cursor (pAge number) is select … Databases oracle | |
Hi to all, Problem Statement: [INDENT]I have 4 nodes which are executing in parallel, each node is processing some information and storing records in MySQL DB, the possible records being saved in an db daily is above thousand, but i want only 100 samples to be stored in db daily, … Databases mysql | |
hi ppl, i am having issue updating the table with details from edited form, and it turns out to be foreign key constraint issue. the error i am getting is, ================================ Cannot add or update a child row: a foreign key constraint fails (`****`.`purchase_order_detail`, CONSTRAINT `purchase_order_detail_component_item_id_component_item_id` FOREIGN KEY (`component_item_id`) REFERENCES … Databases mysql | |
Hello all, I'm using MS Access as my DB for a very simple web site. Everything was running nicely till all of a sudden I can't inset rows into any table in my MS Access database. In my tests I even created a fresh and clean table1 with one number … Databases microsoft-access | |
I have a table that contains ID, lastname and firstname of a person. How to make my stored procedure handle the where conditions using only stored procedure. SELECT * FROM person where lastname = @lastname SELECT * FROM person where firstname = @firstname SELECT * FROM person where ID = … Databases mssql | |
Hi, I have a table with 2 laksh records. If i use rand() in mysql query it takes approximately 1.5 seconds to run So i use mt_rand(1, 200000) It returns most of the times results in 1,000,00s The query is like this. $query = "SELECT * FROM tbl WHERE Length(word) … Databases mysql | |
Hi I have not installed mysql on my own, its the default one that is coming with fedora14 at /usr/local/mysql I am giving you some screenshots, please check if you can find out something. ********************************************************************************************************************************************************* The first issue is while I login using command mysql -u root -p it asks … | |
G'day Folks. This is a general question and not a request for code. I have a client with many DTS packages on their sql server 2000. Has anyone had to migrate these buggers to sql server 2005 or 2008? Was it difficult? - After substantial googling/searching I'm not sure I … Databases client-server mssql sql | |
how do i find the foreign key and primary key constraints of a particular table through a sql query? Databases mysql | |
MyTable: People who moved from Blah City, Blah State: Name Location Date Kids Jack LA 02/05/1999 0 Cindy Chicago 12/15/2005 2 Randy LA 06/19/2003 3 Jason Seattle 04/06/2002 0 1. Who moved to LA? [CODE] SELECT Name, Location FROM MyTable ORDER BY Location; [/CODE] Expected result: LA Jack, Randy What … | |
Hello, I am beginner at DBMS and i want to make a project on it can some body give me ideas about the project according to my level. Waiting for your reply THANKS in Advance ! Databases | |
Hi Everyone, I have a table that has a 2 column primary key. I set up the key where the 2nd column is an identity column. When I ran my VB application I discovered the ID (2nd column) did not increment the correct way. I was hoping it would increment … Databases mssql sql visual-studio | |
Hi guys... I am student of 3rd Year...Soon my final year will be started...I want you guys to suggest me some good and industry related databases project.. I want to use SAP instead of mysql and oracle in my Final Year Project...Actually i want to do project on databases along … Databases oracle web-design | |
How do I decide which data model to use? What determining factors will lead me in the right path for deciding on a model? Thanks, John Databases | |
Hi, today for the first time I get this error Lock wait timeout exceeded; try restarting transaction when using sentence [CODE] UPDATE info_psl SET eil_nr = eil_nr + 1 WHERE eil_nr >= 4 [/CODE] The table is such [CODE] CREATE TABLE IF NOT EXISTS `info_psl` ( `psl_id` int(11) NOT NULL … Databases mysql | |
Hi Everyone, As i wannna to be my Primary Key Em_Id auto increment in MySql but it should be a varchar datatype....as i want my id like em001,em002....something like this.... So can any body help.... Thanks, Ashish Databases mysql | |
USE [DIAMDBF] GO /****** Object: StoredProcedure [dbo].[STOCKREPORT] Script Date: 01/21/2011 11:32:40 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO ALTER PROCEDURE [dbo].[JEWELLSTOCKREPORT] @SELDBNM SYSNAME, @FILENO1 nvarchar(7), @FROMCODE nvarchar(20), @TOCODE nvarchar(20), @START nvarchar(12), @LAST nvarchar(12), @DATE1 nvarchar(12), @DATE2 nvarchar(12), @DATEFORMAT varchar(12), @GROUPCODE char(10), @FROMLOT nvarchar(10), @TOLOT nvarchar(10) AS Declare @execstring … Databases mssql | |
I want to convert a kind of a large MSSQL table to text -- ideally CSV. One crude way would be to use SQL Developer to do a SELECT * and do a copy-and-paste. But there must be a more precise and efficient way of doing this. Perhaps SQL Developer … Databases developer-tools mssql | |
I have 3 tables; Group, MemberOfGroup and Graduates. GroupID is a primary key for Group and MatricNo is a primary key for Graduates. Both GroupID and MatricNo are composite key for MemberOfGroup. I want to show the group lists according to member size. Below is my sql. [CODE]Select g.GroupName, count(m.MatricNo) … Databases mssql | |
![]() | Hi, I would like to know if there is a way to sort data in a table, not when selecting it, but the actual data in the table. I would like to sort it by 2 columns though. For example the "topic" should go from A-Z and then inside all … Databases mysql ![]() |
Hi, I have recently finished a windows desktop application for a client that connects to a sql server database. Throughout development while the server instance was on my local machine the application and server communicated fine with the connection string below [CODE] <add name="myString" connectionString="Data Source=myServerName;Initial Catalog="myDbName";Integrated Security=True" providerName="System.Data.SqlClient" /> … Databases client-server mssql sql | |
A student has a student profile. A student profile can be searched and viewed by empolyers. The student profile contains: [LIST] [*]Skills [*]Qualifications [*]Empolyment History [/LIST] Is it possible to have StudentProfile as a superclass, and the skills, qualifications and empolyment history as sub classes? So that the enetitys can … Databases | |
Hello, I am testing the concept of concurrent transaction using this table definition: ID, int Quota, int Remaining, int Locks, int To simulate multiple users, i'm using threads and having them sleep random amounts of time. So the system is this: 1. User is looking at the details for an … Databases database-design | |
Hey everybody, I have a bit of a complicated project, so here's the details and what I've done so far (sorry for the novel!): I've been asked to convert paper forms to electronic only for a school. My guess is there will be anywhere from 30-50 forms online when it's … Databases database-design | |
At the database level I am trying to understand the difference between having a PK of one table be both a PK and FK in another table vs just being a FK. As an example, I have ORDER, ORDER_ITEM and ITEM entities. According to my Kroenke text, in the ORDER_ITEM … Databases | |
I have the following set of tables but I don't care for the design. It seems like there should be a better way of doing this. Let me explain what's going on: -A visitor comes to our website and has the option of inputting a promotional code when buying our … Databases sql | |
A module leader supervises 1..5 modules. Many module tutors can teach many modules, this is a many to many multiplicity, so i have made a new entity called ModuleuTutorTeaches, in the middle of the 2 entities. What attributes would the 4 tabels have? Module Leader ([U]staff ID{FK}[/U][U]ModuleID[/U]) < this would … Databases | |
hi, i have a site which i want to generate a weekly report of activity from. the monthly report should be fine as i could set the query to format the date into month and where "date" is NOW() however how can i generate a weekly report in mysql? any … Databases mysql | |
Hi, I tried installing MS SQL server 2008 on win 7 Ultimate x86. It was slipstreamed installation with SQL SP1. I got 7 errors during installation. All of them are showing almost similar messages (but different event ids)except the 2nd error (which was about failure to open some registry). The … | |
how to get from table only one column and its downstair data? from this: [URL="http://lashatt.comoj.com/table1.JPG"]http://lashatt.comoj.com/table1.JPG[/URL] show only this: [URL="http://lashatt.comoj.com/table2.JPG"]http://lashatt.comoj.com/table2.JPG[/URL] what will be mysql code of this? Databases mysql | |
I have a database oriented at clients and services provided. In several tables I would like to store documents, e.g. under clients a copy of passport and under companies a copy of the articles of association, mostly pdf's and doc's. Currently I have the documents stored in the respective tables … Databases pdf | |
hi. In the later versions of mysql5.1 we can create an event which can be scheduled accordingly. What is the siimilar way to create in oracle which can be scheduled. Thanks in advance Databases oracle | |
Hi, I'm a database novice and need a few pointers (please). I've created two tables in MySQL: [CODE]CREATE TABLE `Users` ( `Username` VARCHAR( 20 ) NOT NULL , `Password` VARCHAR( 18 ) NOT NULL , `Secret_Question` VARCHAR( 100 ) NOT NULL , `Secret_Answer` VARCHAR( 100 ) NOT NULL, `First_name` Varchar( … Databases mysql |
The End.