Search Results

Search found 13889 results on 556 pages for 'results'.

Page 48/556 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Mysql: Order Results by number of matching rows in Second Table.

    - by KyleT
    I'm not sure the best way to word this question so bear with me. Table A has following columns: id name description Table B has the following columns: id a_id(foreign key to Table A) ip_address date Basically Table B contains a row for each time a user views a row from Table A. My question is how do I sort Table A results, based on the number of matching rows in Table B. i.e SELECT * FROM TableA ORDER BY (SELECT COUNT(*) FROM TableB where TableB.a_id = TableA.id) Thank you!

    Read the article

  • why headers of query results display sometimes in button sometimes in links format ?

    - by I Like PHP
    Hello All, it's just my curiosity to know that why phpmyadmin behavior in different manner when we modify query a bit( putting extra space) then headers of query results, sometime comes in Button format( on hover it say sort, but sorting not working at all) and sometimes in blue link is there any difference for this or it just causing by some othe reason? i m attaching both images. Button headers Link headers

    Read the article

  • Mysql optimization question - How to apply AND logic in search and limit on results in one query?

    - by sandeepan-nath
    This is a little long but I have provided all the database structures and queries so that you can run it immediately and help me. Run the following queries:- CREATE TABLE IF NOT EXISTS `Tutor_Details` ( `id_tutor` int(10) NOT NULL auto_increment, `firstname` varchar(100) NOT NULL default '', `surname` varchar(155) NOT NULL default '', PRIMARY KEY (`id_tutor`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=41 ; INSERT INTO `Tutor_Details` (`id_tutor`,`firstname`, `surname`) VALUES (1, 'Sandeepan', 'Nath'), (2, 'Bob', 'Cratchit'); CREATE TABLE IF NOT EXISTS `Classes` ( `id_class` int(10) unsigned NOT NULL auto_increment, `id_tutor` int(10) unsigned NOT NULL default '0', `class_name` varchar(255) default NULL, PRIMARY KEY (`id_class`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=229 ; INSERT INTO `Classes` (`id_class`,`class_name`, `id_tutor`) VALUES (1, 'My Class', 1), (2, 'Sandeepan Class', 2); CREATE TABLE IF NOT EXISTS `Tags` ( `id_tag` int(10) unsigned NOT NULL auto_increment, `tag` varchar(255) default NULL, PRIMARY KEY (`id_tag`), UNIQUE KEY `tag` (`tag`), KEY `id_tag` (`id_tag`), KEY `tag_2` (`tag`), KEY `tag_3` (`tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ; INSERT INTO `Tags` (`id_tag`, `tag`) VALUES (1, 'Bob'), (6, 'Class'), (2, 'Cratchit'), (4, 'Nath'), (3, 'Sandeepan'), (5, 'My'); CREATE TABLE IF NOT EXISTS `Tutors_Tag_Relations` ( `id_tag` int(10) unsigned NOT NULL default '0', `id_tutor` int(10) default NULL, KEY `Tutors_Tag_Relations` (`id_tag`), KEY `id_tutor` (`id_tutor`), KEY `id_tag` (`id_tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `Tutors_Tag_Relations` (`id_tag`, `id_tutor`) VALUES (3, 1), (4, 1), (1, 2), (2, 2); CREATE TABLE IF NOT EXISTS `Class_Tag_Relations` ( `id_tag` int(10) unsigned NOT NULL default '0', `id_class` int(10) default NULL, `id_tutor` int(10) NOT NULL, KEY `Class_Tag_Relations` (`id_tag`), KEY `id_class` (`id_class`), KEY `id_tag` (`id_tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `Class_Tag_Relations` (`id_tag`, `id_class`, `id_tutor`) VALUES (5, 1, 1), (6, 1, 1), (3, 2, 2), (6, 2, 2); Following is about the tables:- There are tutors who create classes. Tutor_Details - Stores tutors Classes - Stores classes created by tutors And for searching we are using a tags based approach. All the keywords are stored in tags table (while classes/tutors are created) and tag relations are entered in Tutor_Tag_Relations and Class_Tag_Relations tables (for tutors and classes respectively)like this:- Tags - id_tag tag (this is a a unique field) Tutors_Tag_Relations - Stores tag relations while the tutors are created. Class_Tag_Relations - Stores tag relations while any tutor creates a class In the present data in database, tutor "Sandeepan Nath" has has created class "My Class" and "Bob Cratchit" has created "Sandeepan Class". 3.Requirement The requirement is to return tutor records from Tutor_Details table such that all the search terms (AND logic) are present in the union of these two sets - 1. Tutor_Details table 2. classes created by a tutor in Classes table) Example search and expected results:- Search Term Result "Sandeepan Class" Tutor Sandeepan Nath's record from Tutor Details table "Class" Both the tutors from ... Most importantly, there should be only one mysql query and a LIMIT applicable on the number of results. Following is a working query which I have so far written (It just applies OR logic of search key words instead of the desired AND logic). SELECT td . * FROM Tutor_Details AS td LEFT JOIN Tutors_Tag_Relations AS ttagrels ON td.id_tutor = ttagrels.id_tutor LEFT JOIN Classes AS wc ON td.id_tutor = wc.id_tutor INNER JOIN Class_Tag_Relations AS wtagrels ON td.id_tutor = wtagrels.id_tutor LEFT JOIN Tags AS t ON t.id_tag = ttagrels.id_tag OR t.id_tag = wtagrels.id_tag WHERE t.tag LIKE '%Sandeepan%' OR t.tag LIKE '%Nath%' GROUP BY td.id_tutor LIMIT 20 Please help me with anything you can. Thanks

    Read the article

  • Can I retrieve objects from a complex query that limits results to fields from a single table?

    - by Sean Redmond
    I have a model whose rows I always want to sort based on the values in another associated model and I was thinking that the way to implement this would be to use set_dataset in the model. This is causing query results to be returned as hashes rather than objects, though, so none of the methods from the class can be used when iterating over the dataset. I basically have two classes class SortFields < Sequel::Model(:sort_fields) set_primary_key :objectid end class Items < Sequel::Model(:items) set_primary_key :objectid one_to_one :sort_fields, :class => SortFields, :key => :objectid end Some backstory: the data is imported from a legacy system into mysql. The values in sort_fields are calculated from multiple other associated tables (some one-to-many, some many-to-many) according to some complicated rules. The likely solution will be to just add the values in sort_fields to items (I want to keep the imported data separate from the calculated data, but I don't have to). First, though, I just want to understand how far you can go with a dataset and still get objects rather than hashes. If I set the dataset to sort on a field in items like so class Items < Sequel::Model(:items) set_primary_key :objectid one_to_one :sort_fields, :class => SortFields, :key => :objectid set_dataset(order(:sortnumber)) end then the expected clause is added to the generated SQL, e.g.: >> Items.limit(1).sql => "SELECT * FROM `items` ORDER BY `sortnumber` LIMIT 1" and queries still return objects: >> Items.limit(1).first.class => Items If I order it by the associated fields though... class Items < Sequel::Model(:items) set_primary_key :objectid one_to_one :sort_fields, :class => SortFields, :key => :objectid set_dataset( eager_graph(:sort_fields). order(:sort1, :sort2, :sort3) ) end ...I get hashes ?> Items.limit(1).first.class => Hash My first thought was that this happens because all fields from sort_fields are included in the results and maybe if selected only the fields from items I would get Items objects again: class Items < Sequel::Model(:items) set_primary_key :objectid one_to_one :sort_fields, :class => SortFields, :key => :objectid set_dataset( eager_graph(:sort_fields). select(:items.*). order(:sort1, :sort2, :sort3) ) end The generated SQL is what I would expect: >> Items.limit(1).sql => "SELECT `items`.* FROM `items` LEFT OUTER JOIN `sort_fields` ON (`sort_fields`.`objectid` = `items`.`objectid`) ORDER BY `sort1`, `sort2`, `sort3` LIMIT 1" It returns the same rows as the set_dataset(order(:sortnumber)) version but it still doesn't work: >> Items.limit(1).first.class => Hash Before I add the sort fields to the items table so that they can all live happily in the same model, is there a way to tell Sequel to return on object when it wants to return a hash?

    Read the article

  • Apache: Setting DocumentRoot to cgi directory results in downloading file instead of executing it.

    - by fastmonkeywheels
    I have a c-compiled CGI application that I need to execute from the DocumentRoot of my Apache server. The CGI file is called index.cgi and is located at /usr/lib/cgi-bin/index.cgi. I have the following Directory definition <Directory "/usr/lib/cgi-bin/"> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch AllowOverride None Order allow,deny Allow from all DirectoryIndex index.cgi </Directory> I have the following VirtualHost setting: <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /usr/lib/cgi-bin # ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ ErrorLog /var/log/apache2/error.log LogLevel warn CustomLog /var/log/apache2/access.log combined </VirtualHost> If I go to 127.0.0.1 or 127.0.0.1/index.cgi I get prompted to download the index.cgi file, however if I enable the ScriptAlias in the vhost configuration block and go to 127.0.0.1/cgi-bin/index.cgi I see the output of my CGI application. I had originally solved this problem with mod_rewrite, however that worked on my test system the target (embedded) doesn't have that module available so I'm looking at another route (again).

    Read the article

  • File recovery from Mac results in random files and extensions – how do I get my data back?

    - by Robsta
    This Mac hard drive was dying. Someone I knew did a file recovery and got as many files as he could. The program (not sure how it was done, or what program it was) dished out a bunch of folders names such as: DIR56.TOC DIR55.CUR DIR54.GPZ DIR53.GZI … and so forth, all the way down to DIR0.LZH. Some of the file extensions I do understand — like .JPEG, or .MOV — but most of them are ones I've never heard of. I've googled some of them like .TOC, wich stands for "table of contents", but I don't understand how to transfer that data back to the Mac. Currently, they are on a Windows machine. They are being transfered onto an external hard drive that the Mac can read. It can also see all the files. However, the few that I tested to see if the Mac recognizes them (like .TOC and .CUR) cannot be opened. Anyone have any idea as to what I should do? There are some important assignments on there I need to get. EDIT: Data transfer was most likely done by: Easy Recover 6 professional (95% sure, no guarantee)

    Read the article

  • SQL Server restore a backup results in an error.

    - by Mario
    I have a database in dev (SQL Server 2005 on Windows Server 2008) that I need to move to prod (SQL Server 2000 on Windows Server 2003). My process is as follows: Login to dev, open SQL Server Management Studio Right click on the database | Tasks | Backup. Keep all default options (full backup etc.) Move .bak file locally to prod (no network drive), login to prod, open SQL Server Enterprise Manager. Right click Databases node | All Tasks | Restore database. Change Restore as database to reflect the same database name. Click radio button 'From device'. Click 'Select Devices' Click Restore from: Add..., browse to .bak file (small - only 6mb) Now I am ready to restore the database, so I click OK and get the following error: "The media family on device 'E:...bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE DATABASE is terminating abnormally." This error is immediate. I have tried a few different variations of this - restoring the db to dev machine with a different db name and log file names (where it originated), creating an empty database with the same physical path to files before and trying to restore to that, making a few different .bak files and making sure they are verified before uploading them to prod. I know for a fact the directory for the .mdf and .ldf files exist on prod, though the files themselves don't exist. If, before I click OK to restore, go to the options tab instead I get the following error: Error 3241: The media family on device 'E:...bak' is incorrectly formed. SQL Server cannot process this media family. RESTORE FILELIST is terminating abnormally. Anyone have any bright ideas?

    Read the article

  • please explain my fio results - is O_SYNC|O_DIRECT misbehaving on linux?

    - by Zoltan
    I'm going mad over figuring out what the problem could be with one of our storage boxes. With a simple fio script I'm testing random writes using bs=1M and direct=1. The SSD is a Samsung 840pro attached to an LSI HBA (3Gbit/s ports). This is the result I'm getting under FreeBSD 9.1: WRITE: io=13169MB, aggrb=224743KB/s, minb=224743KB/s, maxb=224743KB/s, mint=60002msec, maxt=60002msec This is regardless of sync being set to 0 or 1. On linux, this is the result with sync=0: WRITE: io=14828MB, aggrb=253060KB/s, minb=253060KB/s, maxb=253060KB/s, mint=60001msec, maxt=60001msec and with sync=1: WRITE: io=6360.0MB, aggrb=108542KB/s, minb=108542KB/s, maxb=108542KB/s, mint=60001msec, maxt=60001msec My understanding is that since I'm operating on the raw block device, O_SYNC should not make any difference - there's no filesystem, any barrier, anything between the writes and the drive itself. Especially with O_DIRECT|O_SYNC set. Any ideas? For reference, here's the fio script I'm testing with: [global] bs=1M ioengine=sync iodepth=4 size=16g direct=1 runtime=60 filename=/dev/sdh sync=1 [rand-write] rw=randwrite stonewall

    Read the article

  • What is the command to check if a command's results mention OK?

    - by Manuel
    Alright, so I was playing around with changing MTU size and wanted to make a batch file to automatically lower it and then raise it later. This is probably simple, but I just can't figure it out. Point is, is there a way to run a command, which would normally echo out "ok" but check to see if it does say ok? And if it doesn't say ok then, to end the rest of the file from running and exit out. The command I'm using is netsh interface ipv4 set subinterface "Local Area Connection" mtu=386 store=persistent which, as I mentioned above prints out an OK. I just want to check if it did run correctly, and if not, then do __

    Read the article

  • Why there are two users showing in uptime command results?

    - by Osama Gamal
    Hi, When I ran the uptime on my MacBookPro machine I got the following result: Last login: Thu Jun 3 14:43:40 on ttys000 Osama-Gamal-MBP-2:~ iOsama$ uptime 14:49 up 7 days, 20:10, 2 users, load averages: 0.29 0.24 0.24 Why it lists that there are two users? is it normal? and who is the other user, is it the root user or what? PS: I'm using Mac OS X 10.6.3

    Read the article

  • Pinging computer name in LAN results in public IP?

    - by Bob
    Hi, I recently introduced a new machine to my LAN. The computer name for this machine is 'server'. Historically I've been able to access machines from my home network (from a web browser or RDP) using the machine name and it resolves to a local IP address just fine. However, I can't seem to do this anymore. When I ping the computer name, I get the following: C:\Users\Robert>ping server Pinging server.router [67.215.65.132] with 32 bytes of data: Reply from 67.215.65.132: bytes=32 time=24ms TTL=54 Reply from 67.215.65.132: bytes=32 time=23ms TTL=54 Reply from 67.215.65.132: bytes=32 time=24ms TTL=54 Reply from 67.215.65.132: bytes=32 time=24ms TTL=54 I notice also that it appends the 'router' suffix to my domain name for some reason. 'router' is the name of my router, obviously. I'm also using OpenDNS as my DNS provider (configured through my router so it gets passed down through DHCP). Why is this not working for me? Can someone explain how the DNS resolution should take place? For LAN resolution, it shouldn't go straight to OpenDNS. I thought that each Windows machine kept it's own sort of "mini DNS server" that knows about all machines on the local network and it first tries to resolve using that. Please let me know what I can do to get this working!

    Read the article

  • Have to run auto-negotiate between clients and switch - "old" switch works fine - "new" switch results in "port flapping"?

    - by ConfusedAboutSwitching
    I need some help understanding a problem we're having at work: We run Altiris/Deployment Solution and have to use auto-negotiate between client systems and our switches (Altiris apparently requires this for imaging, PXE boot and other functions). We have several areas with old wiring (Cat 3 & Cat 5) that have old 10/100 Cisco switches in them - and we can set these systems up to "auto/auto" (auto-negotiate on both the NIC and the switch port), and everything has been working fine. But - our networking crew changed out a couple of old switches for 10/100/1000 Cisco switches, and now - they are claiming that "auto/auto" won't work because the switches can't auto-negotiate the way the old 10/100 switches did - and that if we try to set the new gig switches to auto-negotiate, the switch port starts "port flapping", and shuts the port down. But - if we put the old switch back in - they work using "auto/auto" just fine - no port flapping. The networking crew is telling me that the problem is that we're putting "new switches" on "old wire", and that the old cabling can't/won't support the auto-negotiation with these new switches....??? There's something about this that doesn't make sense to me - can someone explain this to me? Or is our networking crew just doing something wrong in the configuration of these new switches? While will the old switches work "auto/auto", but the new switches won't?? HELP!!....and Thanks!! M

    Read the article

  • PES 2012 results in a Nvidia error on Dell N5110 regarding System Requirements?

    - by ???? ???????
    I bought laptop Dell N5110 and installed PES 2012. Nvidia graphics card has 1GB RAM, but when I try to run game message appears that there is just 128MB graphics memory. Here is the message: Warning :Your computer does not meet the Minimum System Requirements to run this software.As a result, you may experience errors during operation.Your Video Card does not meet the required specifications.(GPU:VRAM 128MB) What could be the problem?

    Read the article

  • Ping results "echo'd" out to a text file on Windows XP machine has unusual character rather than the outcome

    - by Richard Rice
    Here is the situation. I have a Windows XP machine that I would like to ping another machine and send the output to a text file for review at a later date. This is quite a standard question with several answers on this website and others. The issue I have is that when reviewing the txt file afterwards, the outcome of the ping appears as a strange character. A screenshot of the text file output can be found at the following link. Please note its the first 8 ping outputs that have a strange character. The %%B was me hoping that would output what I wanted! (Cannot upload image to any hosting websites because the company I work for seems to be afraid of them ....) Here is the code I'm using: @echo off For /f "tokens=1-2 delims=/:" %%b in ("%TIME%") do (set mytime=%%a%%b) PING 1.1.1.1 -n 1 -w 1000 >NUL for /f "tokens=*" %%A in ('ping 192.168.5.2 -w 10 -n 1') do (echo %date% %time% %%A >> C:\Temp\Ping_Checks\GarrickSide.txt && GOTO Ping ) :Ping PING 1.1.1.1 -n 1 -w 1000 >NUL for /f "tokens=* skip=2" %%A in ('ping 192.168.5.2 -w 10 -n 1') do (echo %date% %time% %%A >> C:\Temp\Ping_Checks\GarrickSide.txt && GOTO Ping ) This code works fine on a Windows 7 machine, but not on a Windows XP machine. It appears that the echo command isn't outputting the right data, but I don't understand this enough to correct it. Can anyone spot where I'm going wrong?

    Read the article

  • What are possible results/side effects if replication between DC's in a Windows domain is unable to occur?

    - by hydroparadise
    There's plenty of administration literature out there how to properly manage Windows servers. But in dealing with real life, things don't always occur like you want them to. In Microsoft's Windows Server 2003 Administrator's Companion, out of 1400+ pages, theres only one page that I could find when it comes up setting up additional domain controlers. They make it sound seemless and don't reveal a whole lot on what happens if "peer" DC's are unable to replicate. Down to the specific issue at hand, we had a DC go down about a month ago due to a bad RAID controller. There was nothing critical that waranted imediate attention, so bringing it back up got put on the back burner. A month later, we get the DC back up and running and everyting seemed ok. The next day, nobody is able to logon complaining that the "user does not exist" or "unable to establish a trust relationship". Knowing that I had just put the downed DC back on the network, I immediately took it back off the network and had everybody restart the workstations. After that, exchange was fine, shares became available, and everybody was able to log in. After doing some event log swimming, it would appear that everything started due to replication issues on the SYSVOL. I've read where you can force replication, but that would mean putting it back on the network. I am afraid to put the DC back on the network in fear that something else could go wrong. So, what other issues could one expect to run into where two DC's are unreplicated for over a month?

    Read the article

  • Trying to diagnose network problem: ping 127.0.0.1 (or any address) results in error code 1

    - by Mnebuerquo
    NIC seems to be working, as windows detects the hardware and has a driver and reports success. DHCP seems to have gotten an ip address, 192.168.1.101. I released and renewed it and it seemed to work normally. I tried ping 127.0.0.1 as first step of testing network configuration. Pinging 127.0.0.1 with 32 bytes of data: PING: transmit failed, error code 1. I read somewhere that net helpmsg [error code] would give a human readable name for the error code. net helpmsg 1 says "Incorrect function" I've tried disabling the firewall and antivirus in McAfee SecurityCenter and I still get the same error. Could the firewall/antivirus be breaking it even if disabled? Broadcom Advanced Control Suite 2 is installed, and its network test passes all tests, including ping 192.168.1.1 which is the default gateway. If I try ping 192.168.1.1 from the command prompt I get the error code 1 again. So does anyone have any theories that would explain this problem? Other tests I should try? Thanks!

    Read the article

  • Formula to format a cell to subtract one decimal place from another cell and have the calculated results displayed

    - by user242618
    I have a value in one cell that has four decimal places, in the cell below, I have the metric conversion formula. I want the cell below, with the metric conversion formula to display one less decimal place than the cell above. For example, if the English measurement is .#### (4 decimal places), I need the conversion cell to display .### (3 decimal places) and if the English measurement is .### (3 decimal places), I need the conversion cell to display .### ( decimal places), and so on. How can I do this?

    Read the article

  • How to save Visual Studio Load test results into database.

    - by SonOfOmer
    Hi everyone, I want to know how can I perform VS2008 load test from five different machines and store test results data into one place, for example one database. It is load test that test unit test. I specify scenario and counter sets and I get result and reports that I can save as .trx files. How can I save specific data from test result from 5 different client computers that run the same test into one database and still know which client computer is data from. Thanks a lot.

    Read the article

  • Visual Studio "Find" results in "No files were found to look in. Find stopped progress."

    - by suryasonti
    Sometimes while developing in Visual Studio IDE, when you use "Find in Files" dialog to find something, the search fails and you will see the following message in the "Find Results" window. "No files were found to look in. Find stopped progress." Once this message shows-up all the subsequent searches will result in the same message. Nothing fixes the problem including restarting computer except Pressing "Ctrl + ScrLk". Does anyone know what causes VisualStudio to get into this state and is there a setting to permanently prevent it from happening?

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >