Search Results

Search found 26115 results on 1045 pages for 'table alias'.

Page 27/1045 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Update table.column with another table.column with common joined column

    - by Matt
    Hit a speed bump, trying to update some column values in my table from another table. This is what is supposed to happen when everything works Correct all the city, state entries in tblWADonations by creating an update statement that moves the zip city from the joined city/state zip field to the tblWADonations city state TBL NAME | COLUMN NAMES tblZipcodes with zip,city,State tblWADonations with zip,oldcity,oldstate This is what I have so far: UPDATE tblWADonations SET oldCity = tblZipCodes.city, oldState = tblZipCodes.state FROM tblWADonations INNER JOIN tblZipCodes ON tblWADonations.zip = tblZipCodes.zip Where oldCity <> tblZipcodes.city; There seems to be easy ways to do this online but I am overlooking something. Tried this by hand and in editor this is what it kicks back. Msg 8152, Level 16, State 2, Line 1 String or binary data would be truncated. The statement has been terminated. Please include a sql statement or where I need to make the edit so I can mark this post as a reference in my favorites. Thanks!

    Read the article

  • T-SQL Table Variable Creating PHYSICAL Table!

    - by Mike
    OMG! What am I doing wrong? declare @WTF TABLE ( OrderItemId int ) SELECT TOP 20 OrderItemId as OrderItemId INTO [@WTF] FROM ac_OrderItems SELECT * FROM [@WTF] Problem A: This creates a PHYSICAL table called @WTF. WHY?? I thought this was in memory only?! Problem B: The last line of code, if I do select * from @WTF... WITHOUT the [ ], it returns NOTHING. What is the significance of the [ ]? I need serious help. I'm losing my MIND! Thanks in advance.

    Read the article

  • Speeding up inner joins between a large table and a small table

    - by Zaid
    This may be a silly question, but it may shed some light on how joins work internally. Let's say I have a large table L and a small table S (100K rows vs. 100 rows). Would there be any difference in terms of speed between the following two options?: OPTION 1: OPTION 2: --------- --------- SELECT * SELECT * FROM L INNER JOIN S FROM S INNER JOIN L ON L.id = S.id; ON L.id = S.id; Notice that the only difference is the order in which the tables are joined. I realize performance may vary between different SQL languages. If so, how would MySQL compare to Access?

    Read the article

  • MySQL Select Statement - Two Tables, Sort One Table by Count of Other Table

    - by Robert Boka
    So I have built a voting system for a custom post system i wrote. I want to be able to sort by "most voted", "Most liked", etc. I have two tables. Entry: ID, Title, Post Vote: ID, EntryID, Result I want to be able to query the vote table for each entry and see how many vote's there are, and then sort the entry's by how many vote's each table had. I have messed around with joins, etc. and cannot seem to figure it out. Any suggestions?

    Read the article

  • The Columns in table <table> do not match an existing primary key or unique constraint

    - by Sven
    I have 2 tables, Stores - storeId (int) and year (int(4)) both Primary Keys. fruit - fruitId - Primary Key and storeId. I need to create 1 to many relationship between the Store and Fruit (Foreign Key held within Fruit) how ever I always get shown the error - The Columns in table <table> do not match an existing primary key or unique constraint. The type's are both int and named the same. Any help would be appreciate in advance, many thanks.

    Read the article

  • MySQL query : all records of one table plus count of another table

    - by Ricardo
    Hello Guys! I have 2 tables: User and Picture. The Picture table has the key of the user. So basically each user can have multiple pictures, and each picture belongs to one user. Now, I am trying to make the following query: I want to select all the user info plus the total number of pictures that he has (even if it's 0). How can I do that? Probably it sounds quite simple, but I am trying and trying and can't seem to find the right query. The only thing I could select is this info, but only for users that have at least 1 picture, meaning that the Pictures table has at least one record for that key... But I also wanna consider the users that don't have any. Any idea? Thanks!

    Read the article

  • Adjust CSS of all cells of a specific table without giving each cell a unique id?

    - by javanix
    Is there any way to modify the CSS properties of one table's cells based on the table's ids, rather than specific child ids? I would like to change one table's appearance (giving each cell a colored border, for instance) one way, and another table another way, but I'd like to avoid specifying an id for each cell. To be clear, I don't need to individually access each cell in the table - I just want to set all of the properties of "child" cells of various tables.

    Read the article

  • How to set up email alias in exchange 2010

    - by Rothgar
    I have a couple users who need multiple email addresses (alias) forwarded to their accounts but setting up a separate user and forwarding the email is showing the email to the users main address instead of the aliased email. For example, here is what I need: [email protected] is the users email address but they also need to receive emails sent to [email protected], and [email protected]. When the emails are sent to the other two email addresses I want them to be forwarded to the user and showing that it was sent to the redundancy email address and not john.doe because the user needs to be able to filter these emails as well as reply from the redundancy department email address. How can I set up alias' in exchange 2010 to work this way? Thanks

    Read the article

  • bash alias doesn't carry over with sudo

    - by agent154
    I'm curious if there's a way to get my .bash_profile to work when I sudo a program. For example, I have it set to alias emerge='emerge -av' so that I can install software, and it will always ask me if I want to proceed before downloading and installing. However I just noticed when I sudo emerge foo, it defaults to just the plain command emerge foo instead of emerge -av foo. Only thing that comes to mind to fix this is to also put the alias in root's .bash_profile, but I don't want to have to resort to that since I will always have to make changes in two places when I want to add stuff to my own profile. Is there another way around this that I'm unfamiliar with?

    Read the article

  • Why can't I create an Alias Resource Record Set for an EC2 instance

    - by praterade
    I have been working with AWS for over a year, setting up EC2 instances, domains, ELBs, etc. When I want to assign a subdomain to an EC2 instance, I have to create an elastic IP (that I pay for), then assign a CNAME record to that elastic IP. When I want to assign a subdomain to an ELB (load balancer) instance, I just create an alias resource record set to the ELB. I've read over the docs and don't understand why AWS doesn't support aliasing to instances. Am I missing a key concept here? Wouldn't it be simpler to just alias EC2 instances and skip the whole elastic IP bit?

    Read the article

  • Un-table a cell range in Excel 2007

    - by Joe
    In Excel 2007, if you highlight a block of cells and then "Format as Table", it doesn't just apply colors and formatting, it somehow marks those cells as being a table. Now I want to get rid of the table, but keep all the cells (i.e. keep the data). So I tried clearing the table style and formatting, but Excel still recognizes those cells as being a table. I can tell because: When I select a cell that was in the table, Excel still displays the "Table Tools / Design" tab I cannot merge cells that were in the table <- this is what's annoying me So, how do I un-table those cells? I want to keep all the cell data and formatting, but have Excel not recognize them as a table.

    Read the article

  • Apache redirect alias to a different domain

    - by John Magnolia
    I previous had both Web and Mail on the same server and for each of my vhosts/domains, I could visit example.com/mail or foo.com/mail which would display the Roundcube Webmail across all vhosts. E.g Alias /mail "/usr/share/apache2/roundcub/" Although now I have moved the Mail server onto a completely different server and now have a SSL for the main domain. https://mail.example.com which is now the new location of Roundcube for all vhosts/domains. Question: is it possible to redirect all alias for "/mail" from the Web server to the new URL?

    Read the article

  • Use alias source with relative path

    - by notme
    I want to add an alias file to my project folder to quickly open and edit files in it with a simple shell command. To make it more portable, I would like to use only relative paths. I want something like this: ### .profile source /my/project/folder/aliases.bash and ### aliases.bash editprojectfiles="edit [/my/project/folder/]afile.txt" The problem for me now is how to retrieve [/my/project/folder/] automatically. I tried to use $PWD variable, but the result is that the alias points to the folder of .profile file and not the aliases.bash ones. Is there a way to get this?

    Read the article

  • Single Table Per Class Hierarchy with an abstract superclass using Hibernate Annotations

    - by Andy Hull
    I have a simple class hierarchy, similar to the following: @Entity @Table(name="animal") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name="animal_type", discriminatorType=DiscriminatorType.STRING) public abstract class Animal { } @Entity @DiscriminatorValue("cat") public class Cat extends Animal { } @Entity @DiscriminatorValue("dog") public class Dog extends Animal { } When I query "from Animal" I get this exception: "org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: Animal" If I make Animal concrete, and add a dummy discriminator... such as @DiscriminatorValue("animal")... my query returns my cats and dogs as instances of Animals. I remember this being trivial with HBM based mappings but I think I'm missing something when using annotations. Can anyone help? Thanks!

    Read the article

  • SQL RENAME TABLE command

    - by Nano HE
    Hello. I can run RENAME TABLE student TO student_new ; The command is same and easy to follow. Is there a methods to rename a lot of tables in simple command. Assume all the tables belog to the same DB name. I don't need write a lot of code as below? RENAME TALBE pre_access TO pre_new_access; RENAME TALBE pre_activities TO pre_new_activities; RENAME TALBE pre_activityapplies TO pre_new_activityapplies; RENAME TALBE pre_adminactions TO pre_new_adminactions; RENAME TALBE pre_admincustom TO pre_new_admincustom; RENAME TALBE pre_admingroups TO pre_new_admingroups; RENAME TALBE pre_adminnotes TO pre_new_adminnotes; ... (there are still so many tables need to be renamed)

    Read the article

  • Rails single table inheritance/subclass find condition in parent

    - by slythic
    Hi all, I have a table called Users (class User < ActiveRecord::Base) and a subclass/STI of it for Clients (class Client < User). Client "filtering" works as expected, in other words Client.find(:all) works to find all the clients. However, for users I need to filter the result to only find users that are NOT clients (where type is null or blank). I've tried the following in my index controller but no matter what I put for the type it returns all users regardless of type. User.find(:all, :conditions => { :type => nil }, :order => 'name') Any clue on how to get this condition to work? Thanks!

    Read the article

  • List of objects to JSON to Html Table?

    - by DaveDev
    If I have a list of objects IEnumerable<MyType> myTypes; Is it possible for me to return this to the client as JSON return Json(myTypes); and if so, is it possible for me to convert this (now JSON format) list to a when it gets to the client? Is there any jQuery plugin to do this? The thing is, there's loads of other stuff I need to send as JSON also, so generating a table with a PartialView and embedding that into the JSON is a extra complexity that I'd like to avoid. Thanks.

    Read the article

  • How do i create a table dynamically with dynamic datatype from a PL/SQL procedure

    - by Swapna
    CREATE OR REPLACE PROCEDURE p_create_dynamic_table IS v_qry_str VARCHAR2 (100); v_data_type VARCHAR2 (30); BEGIN SELECT data_type || '(' || data_length || ')' INTO v_data_type FROM all_tab_columns WHERE table_name = 'TEST1' AND column_name = 'ZIP'; FOR sql_stmt IN (SELECT * FROM test1 WHERE zip IS NOT NULL) LOOP IF v_qry_str IS NOT NULL THEN v_qry_str := v_qry_str || ',' || 'zip_' || sql_stmt.zip || ' ' || v_data_type; ELSE v_qry_str := 'zip_' || sql_stmt.zip || ' ' || v_data_type; END IF; END LOOP; IF v_qry_str IS NOT NULL THEN v_qry_str := 'create table test2 ( ' || v_qry_str || ' )'; END IF; EXECUTE IMMEDIATE v_qry_str; COMMIT; END p_create_dynamic_table; Is there any better way of doing this ?

    Read the article

  • HTML Table <thead> Position Fixed

    - by Bry4n
    Variations of this question have been answered, but none of which dealing with my issue. I don't know if this can be achieved or not but I thought if anyone knew they would know on here. I have a table with a thead and one row with many columns. I want the thead to remain fixed (the row is extremely long) however when the thead is fixed, it gets cut off at the end of the browser. Is there a way I can keep it fixed but when you scroll horozontally for the entire page you can see the rest of the thead?

    Read the article

  • ALTER TABLE on dependant column

    - by Sharmi
    I am trying to alter column datatype of a primary key to tinyint from int.This column is a foreign key in other tables.So,I get the following error: Msg 5074, Level 16, State 1, Line 1 The object 'PK_User_tbl' is dependent on column 'appId'. Msg 5074, Level 16, State 1, Line 1 The object 'FK_Details_tbl_User_tbl' is dependent on column 'appId'. Msg 5074, Level 16, State 1, Line 1 The object 'FK_Log_tbl_User_tbl' is dependent on column 'appId'. Msg 4922, Level 16, State 9, Line 1 ALTER TABLE ALTER COLUMN appId failed because one or more objects access this column. Howw should i rectify this?

    Read the article

  • how to build a index table(python dict like) in python with sqlite3

    - by Registered User KC
    Suppose I have one string list may have duplicated items: A B C A A C D E F F I want to make a list can assign an unique index for each item, looks like: 1 A 2 B 3 C 4 D 5 E 6 F now I created sqlite3 database with below SQL statement: CREATE TABLE aa ( myid INTEGER PRIMARY KEY AUTOINCREMENT, name STRING, UNIQUE (myid) ON CONFLICT FAIL, UNIQUE (name) ON CONFLICT FAIL); The plan is insert each row into the database in python. My question is how to handle the error when conflict do happened when insert in python module sqlite3? For example: the program will printing a warning message which item is conflicted and continue next insert action when inserting in python? Thanks

    Read the article

  • Table-level diff and sync procedure for T-SQL

    - by Ville Koskinen
    I'm interested in T-SQL source code for synchronizing a table (or perhaps a subset of it) with data from another similar table. The two tables could contain any variables, for example I could have base table source table ========== ============ id val id val ---------- ------------ 0 1 0 3 1 2 1 2 2 3 3 4 or base table source table =================== ================== key val1 val2 key val1 val2 ------------------- ------------------ A 1 0 A 1 1 B 2 1 C 2 2 C 3 3 E 4 0 or any two tables containing similar columns with similar names. I'd like to be able to check that the two tables have matching columns: the source table has exactly the same columns as the base table and the datatypes match make a diff from the base table to the source table do the necessary updates, deletes and inserts to change the data in the base table to correspond the source table optionally limit the diff to a subset of the base table, preferrably with a stored procedure. Has anyone written a stored proc for this or could you point to a source?

    Read the article

  • Adding STI to Existing Table...

    - by keruilin
    I want to add STI to an existing table using a custom type column. Let's call this taste_type whose corresponding model is Fruit. In the Fruit model I have: set_inheritance_column :taste_type In my migration to add STI I have: class AddSTI < ActiveRecord::Migration def self.up add_column :fruits, :taste_type, :string, :limit => 100, :null => false Fruit.reset_column_information Fruit.find_by_id(1).update_attributes({:taste_type => 'Sour'}) end def self.down remove_column :fruits, :taste_type end end When I run the migration, I get the following error: Mysql::Error: Column 'taste_type' cannot be null: ... Any idea what's going? I can get the migration to run if I comment the set_inheritance_column in the Fruit model, then uncomment it after I run the migration. Obviously, I don't want to do this, however.

    Read the article

  • HTML input type="submit" doubles row height in table

    - by FelixM
    I have a HTML table where some rows have a button like this: <td > <form action="..." method="GET"> <input type="submit" value="..."/> </form> </td> The rows with the input have about twice the height of other rows that have otherwise similar data. When I remove the just the input, the row height goes back to normal. I have the same behavior in Firefox and IE. Is there any way I can have normal row height AND the button?

    Read the article

  • Change color of a table cell using javascript using dropdown menu

    - by Mike Burzycki
    I'd like to use some javascript code to change the background color of a single cell within a table. I have some code below which allows me to change the page background color. This is similar in concept to what I would like to do, but I would really like to be able to change just one cell...not the whole page. I have thought about making the rest of the cell borders and background colors white, leaving the cell I want to manipulate transparent, but I think this probably a brute force method that will cause me trouble down the road. Does anyone have any advice to do this with javascript? The page background color changing code is here: <form name="bgcolorForm">Try it now: <select onChange="if(this.selectedIndex!=0) document.bgColor=this.options[this.selectedIndex].value"> <option value="choose">set background color <option value="FFFFCC">light yellow <option value="CCFFFF">light blue <option value="CCFFCC">light green <option value="CCCCCC">gray <option value="FFFFFF">white </select></form> Thanks for the help, Mike

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >