Search Results

Search found 6257 results on 251 pages for 'columns'.

Page 22/251 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Query a column and a calculation of columns at the same time PostgreSQL

    - by pablo
    Hi I have two tables, Products and BundleProducts that have o2o relation with BaseProducts. A BundleProduct is a collection of Products using a m2m realtion to the Products table. Products has a price column and the price of a BundleProduct is calculated as the sum of the prices of its Products. BaseProducts have columns like name and description so I can query it to get both Products and BundleProducts. Is it possible to query and sort by price both for the price column of the Products and calculated price of the BundleProducts? Thanks

    Read the article

  • last_login_at not working (null) w/ Authlogic Magic Columns...

    - by bgadoci
    I am using the Authlogicgem for authentication and most of it seems to be working great. Authlogic provides several columns that you can add to your Users table (for example) that it knows to fill in if they are present. i.e. login_count, current_login_ip, last_request_at and last_login_at. All seem to be working fine with the exception of the last_login_at field which is null for each user. Is there anything specific that could be causing this perhaps having to do with the user sessions, etc? I can post code if needed but wasn't sure what would relate to this.

    Read the article

  • ssrs: one static row matrix, multiple columns will not filter out nulls

    - by pbarton99
    Using a ssrs 2005 matrix client side. I want to list the multiple addresses of one person, hence one row, multiple columns. The Column field is =Fields!StreetName.Value. The data details field is =First(Fields!StreetPrefix.Value) & " " & First(Fields!StreetName.Value). The datasource has a row for each address; however, some rows will have nulls since the datasource is composed of outer joins. The column grouping works, but the first column is always empty, (first 2 rows of datasource are null) addresses appear only after the empty column. I want to filter out nulls on the matrix, but its like the filter is ignored. I have also tried having the dataset return an empty string for a null streetname and setting the filter to =Fields!StreetName.Value != ="" but no difference. What am I missing?

    Read the article

  • retrieve columns from sqlite3

    - by John Smith
    I have two tables in sqlite: CREATE TABLE fruit ('fid' integer, 'name' text); CREATE TABLE basket ('fid1' integer, 'fid2' integer, 'c1' integer, 'c2' integer); basket is supposed to have count c1 of fruit fid1 and c2 of fruit fid2 I created a view fruitbasket; create view fruitbasket as select * from basket inner join fruit a on a.fid=basket.fid1 inner join fruit b on b.fid=basket.fid2; it works (almost) as expected. When I type pragma table_info(fruitbasket); I get the following output 0|fid1|integer|0||0 1|fid2|integer|0||0 2|c1|integer|0||0 3|c2|integer|0||0 4|fid|integer|0||0 5|name|text|0||0 6|fid:1|integer|0||0 7|name:1|text|0||0 The problem is that I cannot seem to SELECT name:1. How can I do it other than going back and re-aliasing the columns?

    Read the article

  • MySQL: Get unique values across multiple columns in alphabetical order

    - by RuCh
    Hey everyone, If my table looks like this: id | colA | colB | colC =========================== 1 | red | blue | yellow 2 | orange | red | red 3 | orange | blue | cyan What SELECT query do I run such that the results returned are: blue, cyan, orange, red, yellow Basically, I want to extract a collective list of distinct values across multiple columns and return them in alphabetical order. I am not concerned with performance optimization, because the results are being parsed to an XML file that will serve as a cache (database is hardly updated). So even a dirty solution would be fine. Thanks for any help!

    Read the article

  • (NOT) NULL for NVARCHAR columns

    - by Anders Abel
    Allowing NULL values on a column is normally done to allow the absense of a value to be represented. When using NVARCHAR there is aldready a possibility to have an empty string, without setting the column to NULL. In most cases I cannot see a semantical difference between an NVARCHAR with an empty string and a NULL value for such a column. Setting the column as NOT NULL saves me from having to deal with the possibility of NULL values in the code and it feels better to not have to different representations of "no value" (NULL or an empty string). Will I run into any other problems by setting my NVARCHAR columns to NOT NULL. Performance? Storage size? Anything I've overlooked on the usage of the values in the client code?

    Read the article

  • LINQ2SQL: how to merge two columns from the same table into a single list

    - by TomL
    this is probably a simple question, but I'm only a beginner so... Suppose I have a table containing home-work locations (cities) certain people use. Something like: ID(int), namePerson(string), homeLocation(string), workLocation(string) where homeLocation and workLocation can both be null. Now I want all the different locations that are used merged into a single list. Something like: var homeLocation = from hm in Places where hm.Home != null select hm.Home; var workLocation = from wk in Places where wk.Work != null select wk.Work; List<string> locationList = new List<string>(); locationList = homeLocation.Distinct().ToList<string>(); locationList.AddRange(workLocation.Distinct().ToList<string>()); (which I guess would still allow duplicates if they have the same value in both columns, which I don't really want...) My question: how this be put into a single LINQ statement? Thanks in advance for your help!

    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

  • How do I output JSON columns in jQuery

    - by Mel
    I'm using the qTip jQuery plugin to create dynamic tool tips. The tooltip sends an id to a cfc which runs a query and returns data in JSON format. At the moment, the tooltip loads with the following: {"COLUMNS:" ["BOOKNAME","BOOKDESCRIPTION"["MYBOOK","MYDESC"]]} Here's the jQuery $('#catalog a[href]').each(function() { var gi = parseInt($(this).attr("href").split("=")[1]) $(this).qtip( { content: { url: 'cfcs/viewbooks.cfc?method=bookDetails', data: { bookID: gi }, method: 'get', title: { text: $(this).text(), button: 'Close' } }, api :{ onContentLoad : function(){ } }, }); }); As I mentioned, the data is returned successfully, but I am unsure how to output it and format it with HTML. I tried adding content: '<p>' + data.BOOKNAME + '' to api :{ onContentLoad : function(){ ..... to see if I could get it to output something, but I get a 'data is undefined error' What is the correct way to try and output this data with html formatting? Many thanks!

    Read the article

  • MochaUI: 'A is null' when adding columns

    - by Richard John
    I've just downloaded MochaUI, and I'm playing around trying to build an interface. I've successfully created windows, but I'm having trouble when it comes to layouts with columns. I've included all of the libraries in the same order as the demo, and this is in my init code: window.addEvent('domready', function(){ new MochaUI.Column({ id: 'sideColumn1', placement: 'left', width: 200, resizeLimit: [100, 300] }); }); When run, no column is created and I get the error: A is null Does anyone have any ideas? Thanks!

    Read the article

  • Adding new "columns" to csv data file in Tcl

    - by George
    Hi All, I am dealing with a "large" measurement data, approximately 30K key-value pairs. The measurements have number of iterations. After each iteration a datafile (non-csv) with 30K kay-value pairs is created. I want to somehow creata a csv file of form: Key1,value of iteration1,value of iteration2,... Key2,value of iteration1,value of iteration2,... Key2,value of iteration1,value of iteration2,... ... Now, I was wondering about efficient way of adding each iteration mesurement data as a columns to csv file in Tcl. So, far it seems that in either case I will need to load whole csv file into some variable(array/list) and work on each element by adding new measurement data. This seems somewhat inefficient. Is there another way, perhaps?

    Read the article

  • Merging tables in MySQL - sum up columns

    - by Alan Williamson
    I have an interesting problem, that i am sure has a simple answer, but i can't seem to find it in the docs. I have two separate database tables, on different servers. They are both identical table schema with the same primary keys. I want to merge the tables together on one server. But, if the row on Server1.Table1 exists in Server2.Table2 then sum up the totals in the columns i specify. Table1{ column_pk, counter }; "test1", 3 "test2", 4 Table2{ column_pk, counter }; "test1", 5 "test2", 6 So after i merge i want: "test1",8 "test2",10 Basically i need to do a mysqldump but instead of it kicking out raw INSERT statements, i need to do a INSERT..ON DUPLICATE KEY UPDATE statements. What are my options? Appreciate any input, thank you

    Read the article

  • Unique constraint on more than 10 columns

    - by tk
    I have a time-series simulation model which has more than 10 input variables. The number of distinct simulation instances would be more than 1 million, and each simulation instance generates a few output rows every day. To save the simulation result in a relational database, i designed tables like this. Table SimulationModel { simul_id : integer (primary key), input0 : string or numeric, input1 : string or numeric, ...} Table SimulationOutput { dt : DateTime (primary key), simul_id : integer (primary key), output0 : numeric, ...} My question is, is it fine to put an unique constraint on all of the input columns of SimulationModel table? If it is not a good idea, then what kind of other options do i have to make sure each model is unique?

    Read the article

  • LINQ in SQLite for Windows store app does not have 'ThenBy' to order by multiple columns

    - by user1131657
    I have a Windows 8 store application and I'm using the latest version on SQLite for my database. So I want to return some records from the database and I want to order them by more that one column. However SQLite doesn't seem to have the ThenBy statement? So my LINQ statement is below: from i in connection.Table<MyTable>() where i.Type == type orderby i.Usage_Counter // ThenBy i.ID select i); So how do I sort by multiple columns in SQLite without doing another LINQ statement?

    Read the article

  • MySQL COUNT() multiple columns

    - by liam
    Hello, I'm trying to fetch the most popular tags from all videos in my database (ignoring blank tags). I also need the 'flv' for each tag. I have this working as I want if each video has one tag: SELECT tag_1, flv, COUNT(tag_1) AS tagcount FROM videos WHERE NOT tag_1='' GROUP BY tag_1 ORDER BY tagcount DESC LIMIT 0, 10 However in my database, each video is allowed three tags - tag_1, tag_2 and tag_3. Is there a way to get the most popular tags reading from multiple columns? The record structure is: +-----------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | flv | varchar(150) | YES | | NULL | | | tag_1 | varchar(75) | YES | | NULL | | | tag_2 | varchar(75) | YES | | NULL | | | tag_3 | varchar(75) | YES | | NULL | | +-----------------+--------------+------+-----+---------+----------------+

    Read the article

  • dynamic memory allocation of 2d array in which columns are of different size

    - by vishal kumar
    i want to create a 2d array dynamically in c++ language. But in that 2d array columns should be of different size. i mean to say that 2d array should not be in M * N. It should be something like.... 1 2 next line 3 4 5 next line 2 3 4 5 next line 5 next line 4 5 7 I am able to create 2d array in above manner but how to display content of array continously create a problem for me. Please anyone explain me how to come up with this problem.

    Read the article

  • Indexing XMLType columns

    - by Chris
    Hello, I am working with a XMLType and currently experiencing significant performance issues and would like to incorporate indexing to the column type. Currently I am taking the approach of using the XMLTable() and XQuery functions to create a virtual table. I would like to use this Virtual Table to create a function based index on the table containing the XMLType, but I am receiving this error: Error report: SQL Error: ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" *Cause: *Action: This is the index.. any assistance would be greatly appreciated. CREATE INDEX indx_medicinalproduct ON d.ProductName XMLTable('for $i at $a in /safetyreport/patient//drug for $j in $i/medicinalproduct return element r { $i/medicinalproduct }' PASSING s.safetyreport COLUMNS ProductName varchar2(70) PATH 'medicinalproduct') d;

    Read the article

  • postgres - group by on multiple columns - master/detail type table

    - by smpillay
    I have a table order(orderid, ordernumber, clientid, orderdesc etc.,) and a corresponding status for that order on an order_status table ( statusid, orderid, statusdesc, statusNote, statustimestamp) say I have a record in order as below orderid orderumber clientid orderdesc 1111 00980065 ABC blah..blah.. and a corresponding status entries statusid orderid statusdesc statusNote statustimestamp 11 1111 recvd status blah yyyy-mm-dd:10:00 12 1111 clientproce status blah yyyy-mm-dd:11:00 13 1111 clientnotice status blah yyyy-mm-dd:15:00 14 1111 notified status blah yyyy-mm-dd:17:00 How can I get the following result (latest timestamp along with multiple columns) 1111 14 00980065 ABC blah..blah.. notified status blah yyyy-mm-dd:17:00

    Read the article

  • Page break between columns group in RDCL report

    - by sintetico82
    I have on table matrix with columns group. I want that the table length is break on new page if change the group value. Example of my table; GROUP COLUMN 1 | GROUP COLUMN 2 |mounth1 | month2 | month3 | mounth4 | month5 | month6 TEXT1 | ............................................................ TEXT1 | ............................................................ Some one can help me? EDIT: I uploaded an image of the report. It's a very simple matrix table. I would like page break after the "Periodo" column its was changed value. Thank...

    Read the article

  • Alter multiple tables' columns length

    - by gdoron
    So, we just found out that 254 tables in our Oracle DBMS have one column named "Foo" with the wrong length- Number(10) instead of Number(3). That foo column is a part from the PK of the tables. Those tables have other tables with forigen keys to it. What I did is: backed-up the table with a temp table. Disabled the forigen keys to the table. Disabled the PK with the foo column. Nulled the foo column for all the rows. Restored all the above But now we found out it's not just couple of tables but 254 tables. Is there an easy way, (or at least easier than this) to alter the columns length? P.S. I have DBA permissions.

    Read the article

  • Dynamic columns in C# rdlc report

    - by Mugume David
    Suppose I have a report that lists employees (as rows) with their respective taxes charged (in columns). It is possible for a new tax to come up. Since my rdlc report file is currently designed (from XML of-course) to statically generate the coulumns. A future shift in events will need me to alter the rdlc file and add in a new column. how can i do this dynamically. I intend to avoid opening the rdlc file and adding XML code.

    Read the article

  • Copy Data from One SQL Server Table to Other in Same Database Without Specifying Columns

    - by Scott
    In SQL Server there is the ability to INSERT all of the data from one table into another using the following statement: INSERT INTO TABLE1 SELECT * FROM TABLE2 When running this on a table with an identity column, even though we have run the command SET IDENTITY_INSERT TABLE1 ON, we get the error: An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON This implies that we would have to list off all of the columns within the INSERT in order for this to work properly. In the situation that we are in, we do not have access to the column names, only the list of the tables we need to copy over. Is there any way to get around this limitation?

    Read the article

  • select columns by a conact text as columnname in oracle

    - by glaudiston
    I have a table with columns named with the number of hour of day like this: col00 NUMBER(5) col01 NUMBER(5) col02 NUMBER(5) ... col23 NUMBER(5) ...and I have another query that returns a count by hour. I want to recover the colXX value by hour.... then I can recover with "decode" or "case when..." but I want know if exists any way to recover the column by a text like this: select "col"||hour from table; in the hypothetical above example if hour is 13 then would be translated like: select col13 from table; there is any way to do this ?

    Read the article

  • select columns by a concat text as columnname in oracle

    - by glaudiston
    I have a table with columns named with the number of hour of day like this: col00 NUMBER(5) col01 NUMBER(5) col02 NUMBER(5) ... col23 NUMBER(5) ...and I have another query that returns a count by hour. I want to recover the colXX value by hour.... then I can recover with "decode" or "case when..." but I want know if exists any way to recover the column by a text like this: select "col"||hour from table; in the hypothetical above example if hour is 13 then would be translated like: select col13 from table; there is any way to do this ?

    Read the article

  • JPA: Database Generated columns

    - by jpanewbie
    Hello, I am facing an issue with Hiebrnate and JPA. My requirement is column CreatedDTTM and LastUPDATEDDTTM should be populated at the DB level. I have tried following but no use. My columns are set NOT NULL. I get a "cannot insert Null into LastUpdatedDttm" exception. Any guidance is appreciated. @Column(name="LAST_UPDATED_DTTM", insertable=false, updatable=false, columnDefinition="Date default SYSDATE") @org.hibernate.annotations.Generated(value=GenerationTime.INSERT) @Temporal(javax.persistence.TemporalType.DATE) private Date lastUpdDTTM; @Column(name="CREATED_DTTM”, insertable=false, updatable=false) @org.hibernate.annotations.Generated(value=GenerationTime.ALWAYS) @Temporal(javax.persistence.TemporalType.DATE) private Date createdDTTM;

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >