two unique indexes




If there are 10 columns in the table

then can we set "index type" = "unique" for 2 or more columns

Or

is it limited to only 1 column

vineet
Posted On: Monday 31st of December 2012 01:45:56 AM Total Views:  433
View Complete with Replies

RELATED TOPICS OF MYSQL PROGRAMMING LANGUAGE




Problem JOINing two tables

I have two tables, for simplicity lets call them Table AAA and Table BBB, I have a query as follows SELECT count(DISTINCT AAA.ID ) AS post_count, count( DISTINCT BBB.ID ) AS vote_count FROM AAA JOIN BBB ON BBB.user_id = 'John' WHERE AAA.user_id = 'john' Now this query works fine if both the tables contain records with user_id as 'John'. The problem arises when there's no 'John' in any of these two tables. There could be situation in my program where john has a entry in only table AAA or only BBB. In case he has no entries in the any table that corresponding DISTINCT COUNT should be returned as zero.
VIEWS ON THIS POST

82

Posted on:

Thursday 25th October 2012
View Replies!

From one row to two rows ?

Im making a simple document management system (php, mysql) for mainly paper documents and a few electronic ones. Table structure: Code: documents: id(int),fam(varchar(4), number(int), title(varchar) doc_rel : s_id(int), d_id(int), comment(varchar) The fam field indicates a family of documents, like modification (mod), non conformity (noc) etc. The number is a sequential number in that specific family. Both tables do have some more fields, like for dates. The relations are in the doc-rel table. When I make a new relation link for a document with ex. id=4, then this id goes to s_id and the linked document id goes to d-id. So the same document id can be found in s_id and in d_id, for links from it and links to it. To read it, I now use multiple queries. They first looks for a specific number in s_id and then another, almost similar looks to the d_id I like to use one single query where I can get all I need in one time. The output should be sorted on fam and number. Who does have a good suggestion wimb
VIEWS ON THIS POST

75

Posted on:

Thursday 25th October 2012
View Replies!

Querying two tables with similar data

I have two tables in my database "bannerclicks" and "bannerviews". They list the times a banner is clicked or viewed, respectively. They contain similar data, namely: bannerclicks -------------- id INT clickdate DATE bannerid INT bannerviews -------------- id INT viewdate DATE bannerid INT What would my query be if I wanted to display the months in which ANY activity took place (either a banner was clicked, or a banner viewed) I've been playing around with queries like this: Code: SELECT DISTINCT MONTH(bannerclicks.clickdate) AS clickmonth, MONTH(bannerviews.viewdate) AS viewmonth FROM bannerclicks, bannerviews WHERE bannerclicks.bannerid=2 AND bannerviews.bannerid=2 ... but it was all no good. In the end I decided to create one table "Banneractivity" with an additional "action" field to contain either "view" or "click". (in retrospect this is a much cleaner approach anyway) But I'm still curious, how would I solve this problem in the future
VIEWS ON THIS POST

104

Posted on:

Thursday 25th October 2012
View Replies!

Can you merge these two SQL statements?

The first one is to get the row numbers for my paging. The second one is what is ran for the actual paging. I assume you can't join the two because of the LIMIT and offset values. Am i right in thinking that
VIEWS ON THIS POST

85

Posted on:

Thursday 25th October 2012
View Replies!

MySQL Replication and Load Balancing

I'm in the process of building a web app. The service providers I intend to use are now offering really easy to set up load balancers. Perhaps not every client of mine will want load balancing, but for those who do I'd like to offer this. I was thinking of putting the MySQL part on it's own server, then load balancing connections between just the application servers. Each app server would be identical and read from / write to the mysql server. But having just one db server is another single point of failure, so I was thinking of then load balancing between 2 or more database servers with the intention that each database server be identical. reading about mysql replication it takes a master-slave approach so one has to write to just one database, then read from any once again, a single point of failure. then I read about MySQL cluster, but found this in the manual pages Quote: Originally Posted by http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster.html you are very unlikely to be able to switch an existing application datastorethat currently uses, for example, MyISAM or InnoDBto use the NDB storage engine without allowing for the possibility of changes in schemas, queries, and applications. humm, I know nothing about replication (or mysql cluster) and would love so find out more: docs, books, links, best practices, nomenclature, etc can anyone point me in the right direction Many thanks , Quote: Originally Posted by Northie BUT I DON'T KNOW HOW LONG IT WOULD TAKE TO REPLICATE Unless the master or slave is under heavy load the replication itself usually takes a couple of milliseconds. Basically the latency in the network and the execution time of the query. For a simple test on the same box look here. The replication time is usually never a problem unless you are running something that need concurrency which should be in a transaction and only executed against the master anyway. And some more useful information here and here . And out of an monitoring perspective I recommend the pt-heartbeat. So that you are sure that the slaves are all in sync since the default status information from within MySQL is not reliable. Good luck!
VIEWS ON THIS POST

35

Posted on:

Monday 29th October 2012
View Replies!

MySql Query

Guys: I have a table in MySql database which contains marks of students and their classes. Eg. (Jonas, 86, B2)(John, 67,B3). I need a query in sql or mysql which will not only arrange the marks in ascending order but also add the positions in class. Eg(Jonas, 86, 1st), (Evans, 85, 2nd) etc. Please I need y'all help.
VIEWS ON THIS POST

49

Posted on:

Monday 29th October 2012
View Replies!

Can this query be optimized?

I have a site that has a search feature, the search has to look in three colums (tags, title & description) and search two words (singular and plaural), it then builds the pagination and displays the results. The first query, which gets the number of results is SQL Code: Original - SQL Code SELECT COUNT( DISTINCT `newVectors`.`id`) FROM `newVectors` LEFT JOIN `tags` ON `tags`.`vectorId` = `newVectors`.`id` WHERE `valid` =1 AND ( `title` REGEXP \'[[::]]\' OR `title` REGEXP \'[[::]]\' OR `description` REGEXP \'[[::]]\' OR `description` REGEXP \'[[::]]\' OR `tags`.`tag` = 'searchTerm' OR `tags`.`tag` = 'searchTerms' ) GROUP BY NULL;
VIEWS ON THIS POST

81

Posted on:

Monday 29th October 2012
View Replies!

Possible corruption of mysql schema?

all. I suspect that I have corrupted my default schema for the 'mysql' database - where the 'user' table is stored. MySQL experience: Little - but not complete newbie. Premise: I cannot login to my mysql instance with what I think is the correct root password. So, I tried to reset my root password. To do this, my steps are: 1) Using MySQL System Tray Monitor, turn off grant tables. 2) Restart MySQL. 3) Login to mysql using: mysql -u root -p mysql 4) Do: UPDATE user SET host='localhost' and password=PASSWORD('password') where user='root' 5) Error/warning: Error 1292 (22007): Truncated incorrect DOUBLE value: 'localhost' I take this to mean that my mysql schema is corrupted
VIEWS ON THIS POST

112

Posted on:

Monday 29th October 2012
View Replies!

Group By clause

. Let's say I have four tables: fruit vegetable protein meal The first three have two fields, id and type. Only the meal table is different; it has an id and a foreign key for each of the three preceding tables. The records hold as follows (assume the id and type columns): fruit 1 apple 2 orange 3 banana 4 mango vegetable 1 carrot 2 celery 3 broccoli 4 cauliflower 5 salad protein 1 steak 2 beef 3 pork meal Code: mealId fruitId vegetableId proteinId 1 1 1 1 2 1 1 2 3 1 1 3 4 2 2 2 Now, what I want to do is GROUP BY fruit.`type` and COUNT() the number of vegetable groups associated with each fruit. E.g: apple (id of 1) should contain just one vegetable group, the carrot (id of 1) and banana (id of 2) should also count just one vegetable, celery (id of 2). Here's a query I've attempted: Code: SELECT meal.mealId,fruit.`type`,vegetable.`type`,protein.`type`,COUNT(vegetable.`type`) FROM meal,fruit,vegetable,protein WHERE meal.fruitId=fruit.fruitId AND meal.vegetableId=vegetable.vegetableId AND meal.proteinId=protein.proteinId GROUP BY fruit.`type`; Though, in the aliased TOTAL VEGETABLES column the value in the first row should be 1, not 3. It seems to be returning the total number of vegetable rows, as opposed to the number of groups. Anyone have any ideas
VIEWS ON THIS POST

48

Posted on:

Monday 29th October 2012
View Replies!

Mysql 4.1 subqueries

, I'm trying to figure out how to structure this query. I'm sure I am way off as I'm just a beginner. Could someone please point me in the right direction on how to accomplish this Code: select from products (select title from manufacturers where id = products.manid) as mantitle, (select id from manufacturers where id = products.manid) as manid, (select count(id) from products where products.manid = manid ) as count, where products.catid in (2,4,6,8) order by count Here are some sample table structures: PRODUCTS ID-MANID-TITLE-DESCRIPTION MANUFACTURERS ID-TITLE What I am trying to get back in my result set MANUFACTURERID - MANUFACTURER TITLE - NUMBER OF PRODUCTS BY THAT MANUFACTURER IN A CATEGORY LIST
VIEWS ON THIS POST

69

Posted on:

Monday 29th October 2012
View Replies!

USA zip, longitude and latitude table

Hi is there any table available for FREE which has USA zip, longitude and latitude values I have one but it has many missing values of lon and lat for many zip codes so wanted to get a reliable one. so please let me know if you know any such table or xml file etc from where I can get these values. thanks , thanks for your replies.... I have downloaded one from site which was gathered in 2004.. it is working however it has some lon lan values missing for few cities... but it is FREE
VIEWS ON THIS POST

74

Posted on:

Monday 29th October 2012
View Replies!

Trick MySQL Admin to think its Localhost

There are a few features in mysql administrator that are only available if you are connected to a localhost...this is useless if you are using a remote web server, linux based and need to monitor some of this information. Anyone have any idea if there is a way to allow the following functions to work without local host Service Control: Start/Stop Service, Configure service Startup Variables Server Logs: Error Log, Slow Query Log, General Query Log
VIEWS ON THIS POST

75

Posted on:

Monday 29th October 2012
View Replies!

Where clause returns no results

hey new to this forum im creating a website with a mysql database. ive jus got started. im havin a few problems i have a product table and i execute a simple query but it doesnt seem to give me any results heres the query Select * from product where ProductName = 'Age of Empires III'; the above query doesnt work but this 1 does Select * from product where ProductName LIKE 'Age%'; im really confused. need help.
VIEWS ON THIS POST

66

Posted on:

Monday 29th October 2012
View Replies!

Maximum Fields in a Table??

I have a website which runs pretty slow... I have turned on the SLOW-QUERY-LOG, and there's one table that is in the log over and over again... It's the table which stores 99% of the user information. This table has 61 fields, and alot of these are varChar and their set at 100 or so.... Anyways, I was curious what is the maximum amount of fields you should have in table, and in my case should I split the data between several tables and just use a complex Join statement
VIEWS ON THIS POST

40

Posted on:

Monday 29th October 2012
View Replies!

Query with >= doesn't work as I expect

everybody, I've a question. A client application that I can't change, sends queries like the following: SELECT * FROM TABLENAME WHERE TABLENAME.FIELD1>='DUMMY ' AND TABLENAME.FIELD1='DUMMY' AND TABLENAME.FIELD1='STRINGA ' AND TABELLA.CAMPO1='STRINGA' AND TABELLA.CAMPO1
VIEWS ON THIS POST

55

Posted on:

Monday 29th October 2012
View Replies!

Need help with self-join logic

Greetings all, I've been trying several things and doing some research but am having a hard time wrapping my head around how I should go about building this query.. Basically, I have a table created by a Wordpress plugin containing entry requests from end users. What I'm trying to do is come up with a single query to cycle through the entries in this table and create a count of referral types (form_id 9 in the below example). I need this count to only take place on entries created between a certain date range (form_id 14) I've tried doing self-joins using a sub-query to first grab the entries in the correct date range and from there create my count on rows with form_id of 9 inside those results. Unfortunately I'm not having any luck and the more things I try, the worse I confuse myself. Can anyone lend any advice on how I should do this Code: | id | form_id | dataset_id | value | +---------+---------+------------+----------------------+ | 1590968 | 1 | 132586 | John | | 1590969 | 2 | 132586 | Smith | | 1590970 | 3 | 132586 | 123 Any Street | | 1590971 | 4 | 132586 | New York | | 1590972 | 5 | 132586 | NY | | 1590973 | 6 | 132586 | 12345 | | 1590974 | 13 | 132586 | email@domain.com | | 1590975 | 7 | 132586 | 9165551234 | | 1590976 | 8 | 132586 | 9175551234 | | 1590977 | 9 | 132586 | Referral Type | | 1590978 | 12 | 132586 | No | | 1590979 | 14 | 132586 | 05-06-11 | +-------------------------------------------------------+ The above shows an example of one end-user request (dataset_id) how the table is structured. For each dataset_id there is a row for form_id 14 (the entry date) and form_id 9 (the referral type: Online Ad, TV Ad, Website, Radio Ad, etc) What I'm looking for in terms of the COUNT(value) output for form_id 9 is something like: Online Ad: 2 TV Ad: 1 Website: 5 Radio Ad: 15 This will show the amount of entries received as referred by each referral type in a range of time supplied by the reporting script. If anyone can help me with this I would greatly appreciate it. I'm currently working on another attempt and will follow up with it here if it seems like less of a dead-end than my other tries
VIEWS ON THIS POST

72

Posted on:

Monday 29th October 2012
View Replies!

Mysql select from multiple tables / databases

Hy. I'm trying to do a select from multiple databases and tables for an occurence. let's say i have databases db1, db2 and db3. Each have the following tables t1, t2, t3. And in each table there is a field named id which i want to select and a field and p_id which i want to use as a condition. To give a better idea this is an example of what results i want to get: Code: --------------------------------------- |id_t1 | id_t2 | id_t3 | database_name| --------------------------------------- | 100 | 123 | 356 | db1 | | 252 | 156 | 566 | db2 | |... | ... | ... | db3 | --------------------------------------- How can i pass the p_id condition to each table and each database. I tried this: Code: select t1.id as id_t1, t2.id as id_t2, t3.id as id_t3, (select database()) as database_name from db1.t1, db1.t2, db1.t3 where **** ****can't make the condition work because if i only say p_id = 100 it says it's ambiguous**** Code: union select *** all the above *** from db2 and db3 I have also tried with join but it's not what i want (at least how i tried it) because there is no link between tables.
VIEWS ON THIS POST

126

Posted on:

Monday 29th October 2012
View Replies!

Altering WHERE clause to avoid duplicate entries

I have a table with three fields - City, Country and Population. I am using a SELECT to list all possible combination's of each Country and City. SELECT c1.Name, c1.Country, c2.Name, c2.Country FROM City AS c1, City AS c2 WHERE c1.Country != c2.Country; However when I use this command I get duplicate combination's for each, eg. City A | Country A | City B | Country B City B | Country B | City A | Country A How can I alter the WHERE clause to stop this happening Cheers.
VIEWS ON THIS POST

48

Posted on:

Monday 29th October 2012
View Replies!

Using LIKE for search purposes

I'm using LIKE to search for business names in a directory. However, it's being a bit strict. For example, searching for "normans liquor" will not return "Norman's Liquor" because the search string does not include the apostrophe. Is there a way to loosen LIKE's strictness Or am I simply approaching this the wrong way
VIEWS ON THIS POST

80

Posted on:

Monday 29th October 2012
View Replies!

Help with complex join mysql query

, I am hoping someone could help. I have the below sql which use to work but have recently upgraded my server to a new os and mysql 5 , php 5. I know it should not make a different but now my query does not work and I can not figure it out. Maybe I just have a type in my sql that I am not seeing. So here is what I am trying to do I have a employees table which lists which employees are active with us (not term'ed) and also a teams table which tells me which staff is assigned to which supervisor (supervisors swap team members ever other month or so) So the query is to take the highest assign_date from each team member that is assigned to a specific supervisor where the staff member is also still active with us. here is my query PHP Code: $month='2'; $year='2010'; $mygroupwiseid='jdoe'; SELECTteams.rep,teams.assign_dateFROM( \tSELECTrep,MAX(assign_date)ASassignment,\t \tEmployees.EmployeeStatusID,Employees.GroupwiseID \tFROMteams,EmployeesWHEREMONTH (teams.assign_date)
VIEWS ON THIS POST

93

Posted on:

Monday 29th October 2012
View Replies!

Need some ideas - how to manage this best

..
VIEWS ON THIS POST

73

Posted on:

Monday 29th October 2012
View Replies!

Additive query? - I need to add to a row's column value automatically..

I could do this with 2 queries but.. might be faster if isolated through SQL.. What I need to do is add 1 to a value, say my table is named TEST and the column I need to work with is HITS and I already selected which row I would like to modify.. what should I do next so to speak, the query will be interpreted in a way that this value will be manipulated and a 1 will be added to its original stored value.
VIEWS ON THIS POST

98

Posted on:

Monday 29th October 2012
View Replies!

Calculate a value during SELECT

Calculate a value during SELECT In my database table I have a column timestamp with the value of 1167952948 (the time() when it was posted). Another column days stores the value of 30 (the number of days the post is to be active). I want to SELECT active post only. I am trying to calculate the time() the post will expire by taking the value of timestamp + (days * 86400) and compare that to the time it is now, time(). This is what I am trying but it is obviously wrong. Code: SELECT * FROM table WHERE timestamp + days * 86400 >= time() My question: How can I take the value of two fields, calculate another value and then compare that value to today's date Sam ;
VIEWS ON THIS POST

55

Posted on:

Monday 29th October 2012
View Replies!

Join query

hi, i've got two table in the format: referrers --id, name, url, image country_refs --id, name, domain, ref1, ref2, ref3, ref4 and i'm using the query Code: SELECT referrers.name, referrers.url, referrers.image, referrers.description FROM country_refs JOIN referrers ON ref1 = referrers.id OR ref2 = referrers.id OR ref3 = referrers.id OR ref4 = referrers.id WHERE domain = 'gb' this works, but the problem is i need the result set to be in the order of ref1, ref2, ref3, ref4 but currently it's in the order of the referrers table, i.e. in the order it comes across the referrers. Any suggestions Cheers
VIEWS ON THIS POST

66

Posted on:

Monday 29th October 2012
View Replies!

cannot enter "Structure" (was "Error, help!")

I cannot enter"Structure " MySQL said: #1 - Can't create/write to file 'C:\WINDOWS\TEMP\#sql_8e8_0.MYI' (Errcode: 2)
VIEWS ON THIS POST

112

Posted on:

Monday 29th October 2012
View Replies!

Ft_min_word_len=2 not working :(

Hi , I am new here and was hoping someone could help me figure out an annoying problem. I have a mysql db with certain tables Full Text searching. The searching brings up great results so I can't complain there. The problem is when I want to search for 3 letter acronyms. I always get 0 result although I have the minimum set to 2. Could I have something incorrect in my cnf file or could something else be going on. I know there are records because if I search for example RSS feeds it brings up those records but if I just type RSS it brings up none. Any ideas would be greatly appreciated.
VIEWS ON THIS POST

50

Posted on:

Monday 29th October 2012
View Replies!

print patient and doctor for operation on specific date (was "Very Confused!!")

Hi all, Having a few troubles again now lol. Ive got 3 Tables one of which is patient (name, address, ageetc), Doctor (again name address etc) and finally Operation (PatientCode, DoctorCode, Type and date etc). Im trying to get a SQL query which will print all the details of the patient and doctor who had/performed an operation on a specific date. So far I have this Code: SELECT PatientCode, DoctorCode From Operation WHERE Date = '21/11/05' Now that gives me a table containing 4 patient codes in patientcode colum and 4 doctorcodes in the doctorcode column. Now my qquestion is how would I go about getting the patient and doctors details from here\t. I've looked around the internet on tutorials and such but have come to no avail as all examples which are simlair to this are simlair in a way of their is only one table to compare it to (would be like just obtaining the patient details only) which I can do fine. Just when it comes to merging the two tables I cant do it. Any Ideas\t
VIEWS ON THIS POST

61

Posted on:

Monday 29th October 2012
View Replies!

Arithmetic overflow error

I am getting the following error: Microsoft OLE DB Provider for SQL Server error 80040e57. Arithmetic overflow error converting numeric to data type numeric positionDisplay.asp line 21 ---- Here is line 21 rsCountPos.open appCountSQL,conn,1,1,1 The strange thing is that this just started after January 1st. On our site we get online job applications and there is also a way for us to go into an 'admin' area of our site to view the app details. We are getting this error only on applications submitted after Jan 1st. Everytime someone submits an application they receive a number. The number is the month, day, year, and then the number of the application received for that day. For example, app_id = 092120040005 - this would be the fifth application we received on 09/21/2004. I know practically nothing about SQL and this was kind of put in my lap. Please help! Point me in some direction.
VIEWS ON THIS POST

57

Posted on:

Wednesday 7th November 2012
View Replies!

MyOLEDB connection problem

Heres some information about my setup: - .net framework 1.1 sdk installed - Microsoft MDAC 2.7 installed - Microsoft odbc.net provider installed - Mysql Servers and Clients install (this is the acctual server) installed - MySQL Connector/ODBC driver installed - setup odbc DSN for my database called "mysql_praxis" - MyOLEDB provider (myoledb3.exe) installed ok, i have been able to successfully connect to the database using ODBC by copying the ODBC.NET dll into the bin directory and using the microsoft.data.odbc namespace. What i cannot do is connec to the database using OLEDB. I installed the OLEDB provider and copied the Myprov.dll into the bin directory of my application. My code looks as follows: Praxis OLEDB test void Page_Load() { String strConnection, strSQL, strPath; OleDbDataReader objDataReader = null; strConnection = @"Provider=MySqlProv;SERVER=127.0.0.1;DB=praxis;UI D=praxisadmin;PWD=1118"; strSQL = "select * from user"; OleDbConnection objConnection = new OleDbConnection(strConnection); // Connect OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection); // Prepare command objConnection.Open(); objDataReader = objCommand.ExecuteReader(); if (objDataReader.Read() == true){ welcomeLabel.Text = "Username = " + objDataReader["username"] + ", Password = " + objDataReader["password"] + ", firstName = " + objDataReader["firstName"] + ", lastName = " + objDataReader["lastName"] + "!"; } objDataReader.Close(); objConnection.Close(); } When i attept to load this page nothing happens, no errors, it just never loads. It says "waiting for localhost" and nothing ever loads. Somebody help!
VIEWS ON THIS POST

71

Posted on:

Wednesday 7th November 2012
View Replies!

How can I retreive the last but one record?

I have a table containing statistics that are ordered by week. The table is updated every week. What I want is to retrieve the previous week numbers (the whole row). Is there any SQL-statement that can do that
VIEWS ON THIS POST

149

Posted on:

Saturday 10th November 2012
View Replies!

ASP & Stored Procs

Originally posted by : Matt (matthew.brown@lmsuk.com)Does anyone have any experience of calling stored procedures from ASP I'm specifically interested in how well this mechanism performs in a multi-user environment with SQL7As opposed to say using COM objects to handle the data access stuff and shuttle the requests / data back and forth between the ASP page and the database.Any advice would be most welcome.TIAMatt
VIEWS ON THIS POST

46

Posted on:

Saturday 10th November 2012
View Replies!

webfetch and db

Originally posted by : marius (mmarius@mail.com)I need this custom script made pretty quick and im not that good in asp yet so I need some help.If I cant get any free help I guess Ill pay someone to write it...so please....anyway.This is what the script needs to do:- Get urls in different categories from a access database.- Fetch all links from the urls but only where the link points to a .jpg file.- Print out pages with ten textlinks(numbers) on each page and a link to next and previous. eg. 1 2 3 4 5 6 7 8 9 10 | Next page ->- The urls in the database needs to be in different categories so that if the user clicks on eg. "Mercedes Benz" in the menu on the mainpage he is taken to the mercedes link page.- The urls need to be sorted by date so that the latest added urls prints out the lowest numbers
VIEWS ON THIS POST

74

Posted on:

Saturday 10th November 2012
View Replies!

Help with selects

, I need to create some output in a particular way. I have 4 tables and need certain data from all of them. The only thing is, I don't want to repeat a lot of the data. The tables are T_Departments, T_Priorities, T_Strategies, and T_Initiatives. With the exception of Departments, each table has a set of goals. Priorities is the top table and has some goals and under each goal is a set of Strategies, and under each Strategy is a set of Initiatives. Each Department has their own set of P's, S's, and I's. I want to be able to output each priority in a department with the strategies and initiatives listed under it. The only problem is, I don't want the priority numbers or descriptions to be listed EVERY time it lists a Strategy. For instance Priority 1 Strategies 1 and 2.... I DON'T want it to be listed like: Priority 1 Strategy 1 Priority 1 Strategy 2 and so on. I want it to be like this: Priority 1 Strategy 1 Initiative 1 Initiative 2 Strategy 2 Initiative 1 Priority 2 and so on. Any idea how I can do this
VIEWS ON THIS POST

68

Posted on:

Monday 12th November 2012
View Replies!

Query By Date Help

again. Either I am doing something wrong ehre or the DB is just taking way too long to respond to my query. This "should" be correct, no 'Open Date & Time' is a Date Field, also has time. Code: "SELECT * FROM my_table WHERE [State:] = 'O' AND MONTH([Open Date & Time]) = 4 AND DAY([Open Date & Time]) = 10 AND YEAR([Open Date & Time]) = 2009" Its not bringing back any errors exept timing out. I have verified Entries exist with the Data given above. Help is greatly appreciated.
VIEWS ON THIS POST

50

Posted on:

Monday 19th November 2012
View Replies!

SQL Roles and connection types

What type of role should i set up for my websites database (just to display data) I know that is should be separate to the owner etc. Also when should i use the standard ODBC security, or trusted connections Cheers
VIEWS ON THIS POST

60

Posted on:

Monday 19th November 2012
View Replies!

SQL query problem

Can sombdy please help me.. I have a table uid status date_updated 3 45 09/23/2003 4 67 08/10/2004 * 4 67 09/12/2004 5 90 11/10/2003 6 34 06/10/2004 7 56 09/03/2003 * 7 56 11/09/2004 9 56 08/23/2004 ... I want distinct status in same uid's with latest date_updated. The o/p should be like: uid status date_updated 3 45 09/23/2003 4 67 09/12/2004 5 90 11/10/2003 6 34 06/10/2004 7 56 11/09/2004 9 56 08/23/2004 ... I'm trying my best. Can sombdy please help me
VIEWS ON THIS POST

84

Posted on:

Monday 19th November 2012
View Replies!

having problem during upsizing from local access table to remote sql server

!! i have problem in upsizing data to remote sql server . my test connectivity is ok. some time if i specifi my database which is in remote sql server it is giving "overflow error " , if i use master data base i am not getting any error ,but i am not getting the repote generated when sql table is created. i am very new to sql is there any other method i any one guite me . i have to write a vc++ code , through which i have to update local access table and once the access table is updated , i have to transfer all the data to remote sql server using ip address. once the data is updated in sql server i have to delete the data in access table . please help me !!!
VIEWS ON THIS POST

112

Posted on:

Monday 19th November 2012
View Replies!

SQL SELECT troubles...

I'll be direct, below is the problem I am having. I tried to explain it as best as I can. If I missed something, please let me know. This has been trying my patiences and I have a feeling there is an easy solution, but for the life of me I can't figure it out. Description of what's what and coming from where: A = cat_a from category A Space 888-555-1234 = bname and btel from directory Golfer = cat from catefory Working code, but not in the order I am trying to output: Code: mySQL = "SELECT category.idcat, directory.idcat, cat, cat_a, bactive, bname, btel FROM category, directory WHERE bactive=-1 AND category.idcat=directory.idcat ORDER BY cat_a, bname ASC" A Art Group 888-555-1234 Architects AT Pages 888-555-1234 Advertising Barthrop 888-555-1234 Attorneys Brackett 888-555-1234 Gardener __________________________________________________ ___________________________ Working code, but only half of what I need to output Code: mySQL = "SELECT bname, btel FROM directory WHERE bactive=-1 ORDER BY bname ASC" A Space 888-555-1234 A Center 888-555-1234 A Clinic 888-555-1234 etc... to Z's __________________________________________________ ___________________________ The other half: Code: mySQL = "SELECT cat_a, cat FROM category ORDER BY cat_a" A B C etc... to Z __________________________________________________ ___________________________ What I am trying to do is combine Code: mySQL = "SELECT bname, btel FROM directory WHERE bactive=-1 ORDER BY bname ASC" Code: mySQL = "SELECT cat_a, cat FROM category ORDER BY cat_a" To output: A A Space 888-555-1234 Golfer A Center 888-555-1234 Sailor A Clinic 888-555-1234 Tennis B B Space 888-555-1234 Groomer B Center 888-555-1234 Trainer B Clinic 888-555-1234 Auto C C Space 888-555-1234 Plummer C Center 888-555-1234 Planter C Clinic 888-555-1234 Stemmer etc... to Z __________________________________________________ ___________________________ So I try this: Code: mySQL = "SELECT bname, btel, cat_a FROM directory, category WHERE bactive=-1 ORDER BY bname ASC, cat_a" I get page can not be displayed. HTTP500
VIEWS ON THIS POST

60

Posted on:

Tuesday 20th November 2012
View Replies!

Before i get ahead of myself.. database design critque plllleeassee...

Scope of project:create simple browse down (+search) engine/site for various telecom and networking parts arranged by manufactuer then brand then part to show a list of vendors that carry said product arranged by price and reorderable.. In reading other posts, figure it might not be a bad idea to run down my little structure and some sample data.. ttProducts prodID (autonumber) item (m7310, Trunk Module) model (NT8B75, VB-44210) manuID (from ttManu, to identify manufacturer) catID (from ttCat, to identify category) photo (for addition of url to pic) ttManu manuID (autonumber) manu (Nortel Networks - Norstar) ttCategory catID (auto) category (category part may fit in, Phones, Cards, Voicemail..) ttVendors vendorID (auto) company address1 address2 city, state, zipcode, phone, phone800, fax, email, website, login, password, descrip, added_on, active ttInventory the table to tie em all together invID (auto) prodID (from ttProducts) vendorID (from ttVendors) newprice (price for part new, if any) refurbprice (price for part used, if any) oosprice (price for part out of service, if any) warranty venddescrip (short description from vendor for said part) ttFeedback feedID (auto) vendorID (identifies who feedback was left for) feedback (comments) dateleft leftby -------------------- whole point of project is simple easy browse down to part, then see list of vendors. User selects Maufacturer from home page, is presented with a list of categories for parts matching said manu. User selects cateogry and is presented with list of all parts matching manu and category. User clicks part and is presented with list of vendors, 1 to 3 prices (whatever vendor filled in for part when adding it to browse) plus shot descrip from vendor if they left one, if not, filled in with vendor main descrip, if none, call blank. List is presented with lowest NEW price first and may be reordered by lowest Refurb price and again by lowest OOS Price, but all data displayed remains the same. user may alternativly use a single serach text box to query db and pull anything that matches what they typed in in price order from the inventory table.. Will that data seem at first glance to fit together ok
VIEWS ON THIS POST

92

Posted on:

Tuesday 20th November 2012
View Replies!

Firing/sending mails automatically

Originally posted by : Mandeep (mandeeps_b@yahoo.com)i have SQL serVER and IIS installed on two differnet machinesI wish to fire mails automatically at the specfied by the users who visit my siteat their specified time. can u help me with the codes and the idea
VIEWS ON THIS POST

68

Posted on:

Tuesday 20th November 2012
View Replies!

Data Grid/Microsoft Access/Replication ID

Originally posted by : Manuel (manuel.adam@chello.at)!I created a Mirosoft Access Database, where I chosed to use AutoNumber -> Replication ID / the primary key. I followed the WALKTHROUGH included in VISUAL .NET ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbwlkWalkthroughUsingDataGridWebControlToReadWrite Data.htmBut because I use Replication ID as data type in Mirosoft Access, I cannot update data in the data Grid!So I get an error when clicking on update, where the code is:Adapter.Update(datasheet1);>Invalid cast from System.String to System.Guid. etc.I tryed then to use a Long Integer in Microsoft Access instead of Replication ID,then it works. But I really need Replication ID, do someone know any solution for this\tManuel
VIEWS ON THIS POST

36

Posted on:

Tuesday 20th November 2012
View Replies!

Merge data from many lines to one line in recordset

I'm using SQL 2005 DB with ASP VB. I'm creating a 6-month forecast report which tells us how many people we have working for us at any given start date. I have a table which is employment records for in the company. The asp page looks at each record to see whether a person was working for us during each month within the selected date range. The problem I have is that one person can have one employment record with a start date and end date, as well as another employment record with a start date that is adjacent to the previous end date (i.e. maybe they got a pay rise - that's a new employment record). Currently my report shows these same people on 2 lines (1 for each record), where what I really want is to show that person as having continuous employment on the 1 line. Does anyone please have any idea as to how I could do this Many
VIEWS ON THIS POST

49

Posted on:

Tuesday 20th November 2012
View Replies!

SQL Reporting Services

Is anyone out there using SQL Reporting Services If so, I have a question for you. I am using the jump to URL option in my report. The report is rendered by SQL Reporting Services, and it works just fine. However, I get the following error message on the page everytime I use the jump to URL feature: "Object doesn't support this property or method". The odd thing is, that it works fine otherwise, but I only see this error on the pages I have set as links from other reports (using the URL instead of the Jump to Report feature). It does not seem to matter whether the destination report is part of the project or not, however, it should be noted that the links are created dynamically based on the parameters of the report. I create the string using the Expression Builder in SQL Reporting Services. Any ideas Is this a Microsoft problem
VIEWS ON THIS POST

45

Posted on:

Tuesday 20th November 2012
View Replies!

SELECT statement question...

Originally posted by : Brclev (brclev@aol.com)Is it possible to change the FROM element in a SELECT statement "on the fly" What I mean is I need the FROM element of the SELECT statement to update depending on what choice is made from a drop-down menu. Is this possible If so, I would really appreciate some help.
VIEWS ON THIS POST

94

Posted on:

Tuesday 20th November 2012
View Replies!

JPG data from a OLE object in Access 2000

Originally posted by : Help if only I could affor a real DB ) (peter_crabb@ntlworld.com):0)I have managed to extrude the binary data a picture field, but this does not just include the stored jpg. The binary data is wrapped as a OLE Object. (dam)Any suggestions on getting the jpg data only.PeteSome code below//imports and stuffvoid Page_Load(){ string strConnection "Provider=Microsoft.Jet.OleDb.4.0;";strConnection += @"Data Source= " + Server.MapPath("..\db\images.mdb");string strSQL = "SELECT PicKey, Picture FROM Images WHERE PicKey=1";OleDbConnection objConnection = new OleDbConnection(strConnection);OleDbCommand objCommand = new OleDbCommand(strSQL, objConnection);OleDbDataReader objDataReader = null;try{objConnection.Open();objDataReader = objCommand.ExecuteReader();while(objDataReader.Read()){con_close.Text = "the data type = ": //objDataReader.GetDataTypeName(0);Response.BinaryWrite((byte[]) objDataReader["Picture"] );}objDataReader.Close();objConnection.Close();}catch (Exception e){//TO DO: Suggest the a black small image with exeption is generated}}Reading data from the connection
VIEWS ON THIS POST

46

Posted on:

Tuesday 20th November 2012
View Replies!

Using a cube

I wasn't sure where to post this question so here it is: Is using a cube as a datasource for SQL Reporting Services faster than using a regular SQL database and stored procedures What I mean is will the results be obtained faster
VIEWS ON THIS POST

60

Posted on:

Monday 26th November 2012
View Replies!

editing datagrid

Originally posted by : Karin Vanderheide (kvdheide@godutch.com) I seem to be having problems using the OnUpdateCommand and OnCancelCommand in my datagrid: can anyone see where my error isWhen I use the edit button... the boundcolumn turn to textboxes and I receive the response.write message "edit row".However, when i click on the update or cancel button nothing changes... it's like the function in never invoked or run. the response.writes' don't display either.please help! i can't look at it anymore. 'Edit rowpublic sub EditRow(sender as Object, e as DataGridCommandEventArgs) response.write("edit row") CustomerDataGrid.EditItemIndex = e.Item.ItemIndex BindData(sorting,filter)end subpublic sub CancelUpdate(sender as Object, e as DataGridCommandEventArgs) response.write("cancel update") CustomerDataGrid.EditItemIndex = -1 BindData(sorting,filter)end subpublic sub UpdateRow(sender as Object,e as DataGridCommandEventArgs) response.write("update row") Dim editTitle As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox) Dim Item as String = e.Item.Cells(1).Text Dim title As String = editTitle.Text response.write(Item & title) CustomerDataGrid.EditItemIndex= -1 BindData(sorting,filter)end sub
VIEWS ON THIS POST

68

Posted on:

Monday 26th November 2012
View Replies!

table standing

hallo ,first i want to say that i`m fairly new to Php and Mysql .My problem is,i`m making a site for soccer predictions , and i want to show table standings of the leagues .First i want to ask you how i can do it to upgreade dinamycilly the tables .I created 2 tables ,one with the standing and the other with with result , i will show you the code $sql=mysql_query('SELECT * FROM res WHERE match_id=10'); while($row=mysql_fetch_assoc($sql)) { $home_team=$row['home_team']; $away_team=$row['away_team']; $home_team_goals=$row['home_team_goals']; $away_team_goals=$row['away_team_goals']; } if($home_team_goals>$away_team_goals) { $s=mysql_query('UPDATE ') } this is not finished ,but you get the idea i will update the standing table with a lot of ifs ,the question is can i do it more simple My other question is because i never uploaded site in internet ,will i have acces to my tables in mysql so i can upgrade them all the time
VIEWS ON THIS POST

89

Posted on:

Sunday 30th December 2012
View Replies!