Search Results

Search found 7127 results on 286 pages for 'calculated columns'.

Page 139/286 | < Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >

  • display one-to-many relationship for a model in Django admin (list mode)

    - by theactiveactor
    In Django admin site, when listing all the objects for a given model, I know we can customize which columns get displayed for a ModelA via list_display Say that ModelA has a one-to-many relationship with ModelB. I would like to add another column on the listing page for ModelA, where each entry is a URL pointing to all objects of ModelB having a foreign key relationship on corresponding instance of Model A in that row. How can I achieve this customization with the admin app?

    Read the article

  • How to make a report with count of type of cases in each month in Acess 2010

    - by amir shadaab
    I have a database is access with each record having a date and yes/no type columns for each record which shows which category the record comes under. I want to create a report which shows the types of cases in each month by taking a date range as a parameter through prompts. I have done the prompt part but I'm not sure how the query should be to show values for each month in that date range. Can someone please help me with this?

    Read the article

  • Are there any modeling tools that can visually generate jpa or sql queries?

    - by Shervin
    Does anyone know of a tool like PowerArchitect or SquirrelSQL or maybe eclipse plugin that lets you also generate jpa/sql queries? Imagine you choosing your database, or your entity beans, and the modeling would reverse engineer your database/entity model, so that you could visually just choose the columns you wanted to select, and it would generate jpa or sql queries for you. For instance choosing A.b and X.y would generate something like this: select a.b, x.y from A a, X x join ......

    Read the article

  • What are my best ASP.Net GridView replacement options?

    - by Homer
    We currently use a GridView to display 1000+ rows of data. Minimum requirement for replacement is a fixed header row, fixed footer and columns would be a plus. This would have to work across IE 6 and greater. I've heard good things about Infragistics, but the demo on their page is slow. So what are my best options? jQuery? YUI? other 3rd party?

    Read the article

  • Enable or disable column based on other column

    - by kundan
    Hello, I have Application with 3 columns Result - Radio button pass and Fail IF Fail - Radio Button Minor and Major Be Specific - Multiple Choice - Active X control/ Browser/ Display / Others I want to disable If fail and Be specific if Result is selected pass. How can I do it Thanks Kundan

    Read the article

  • Help with MySQL query

    - by Michael S.
    I have a table that contains the next columns: ip(varchar 255), index(bigint 20), time(timestamp) each time something is inserted there, the time column gets current timestamp. I want to run a query that returns all the rows that have been added in the last 24 hours. This is what I try to execute: SELECT ip, index FROM users WHERE ip = 'some ip' AND TIMESTAMPDIFF(HOURS,time,NOW()) < 24 And it doesn't work. Can someone help me out? Thanks :)

    Read the article

  • Where to find free-to-use, complex test databases?

    - by Jay
    I need a database for testing a data masking solution. Any database would do (Oracle/MSSQL flavor). I just need the schema / db definition. I have tools to generate data records. The magnitude of database I am looking should have 30 odd tables with 30 odd columns in each table - a HUGE database. Do freely available complex database /schema definitions exist on the internet? If yes, where do I find them?

    Read the article

  • Reorganizing MySQL table to multiple rows by timestamp.

    - by Ben Burleson
    OK MySQL Wizards: I have a table of position data from multiple probes defined as follows: +----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+----------+------+-----+---------+-------+ | time | datetime | NO | | NULL | | | probe_id | char(3) | NO | | NULL | | | position | float | NO | | NULL | | +----------+----------+------+-----+---------+-------+ A simple select outputs something like this: +---------------------+----------+----------+ | time | probe_id | position | +---------------------+----------+----------+ | 2010-05-05 14:16:42 | 00A | 0.0045 | | 2010-05-05 14:16:42 | 00B | 0.0005 | | 2010-05-05 14:16:42 | 00C | 0.002 | | 2010-05-05 14:16:42 | 01A | 0 | | 2010-05-05 14:16:42 | 01B | 0.001 | | 2010-05-05 14:16:42 | 01C | 0.0025 | | 2010-05-05 14:16:43 | 00A | 0.0045 | | 2010-05-05 14:16:43 | 00B | 0.0005 | | 2010-05-05 14:16:43 | 00C | 0.002 | | 2010-05-05 14:16:43 | 01A | 0 | | . | . | . | | . | . | . | | . | . | . | +---------------------+----------+----------+ However, I'd like to output something like this: +---------------------+--------+--------+-------+-----+-------+--------+ | time | 00A | 00B | 00C | 01A | 01B | 01C | +---------------------+--------+--------+-------+-----+-------+--------+ | 2010-05-05 14:16:42 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:43 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:44 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:45 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:46 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:47 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | . | . | . | . | . | . | . | | . | . | . | . | . | . | . | | . | . | . | . | . | . | . | +---------------------+--------+--------+-------+-----+-------+--------+ Ideally, the different probe position columns are dynamically generated based on data in the table. Is this possible, or am I pulling my hair out for nothing? I've tried GROUP BY time with GROUP_CONCAT that roughly gets the data out, but I can't separate that output into probe_id columns. mysql SELECT time, GROUP_CONCAT(probe_id), GROUP_CONCAT(position) FROM MG41 GROUP BY time LIMIT 10; +---------------------+-------------------------+------------------------------------+ | time | GROUP_CONCAT(probe_id) | GROUP_CONCAT(position) | +---------------------+-------------------------+------------------------------------+ | 2010-05-05 14:16:42 | 00A,00B,00C,01A,01B,01C | 0.0045,0.0005,0.002,0,0.001,0.0025 | | 2010-05-05 14:16:43 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:44 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:45 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:46 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:47 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:48 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:49 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:50 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:51 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | +---------------------+-------------------------+------------------------------------+

    Read the article

  • How to set header font style as bold for the header of the table in a pdf file, in jsf

    - by Radhika
    Hi I have used PdfPTable to convert table data into a pdf file using com.itextpdf.text.pdf.PdfPTable. Table is displaying, but table data and the header are in same style. To make difference i have to set the header font style to bold. can anybody help me out in this, I have attached my code here.. Thanks in advance import java.awt.Color; import java.util.ArrayList; import java.util.List; import javax.faces.model.ListDataModel; import com.mypackage.core.filter.domainobject.FilterResultDO; import com.itextpdf.text.Font; import com.itextpdf.text.FontFactory; import com.itextpdf.text.Phrase; import com.itextpdf.text.pdf.PdfPTable; public class PDFGenerator { //This method will generate PDF for Filter Result Screen (only DataTable level) @SuppressWarnings("unchecked") public static PdfPTable generatePDF(PdfPTable table,List filterResultDOList ,List filterResultHeaderList ) { //Initialize the table with number of columns required for the Datatable header int numberOfFilterLabelCols = filterResultHeaderList.size(); //PDF Table Frame table = new PdfPTable(numberOfFilterLabelCols); //Getting Filter Detail Table Heading for(int i = 0 ; i < numberOfFilterLabelCols; i++) { ColumnHeader commandHeaderObj = filterResultHeaderList.get(i); table.addCell(commandHeaderObj.getLabel()); } //Getting Filter Detail Data (Rows X Cols) FilterResultDO filterResultDOObj = filterResultDOList.get(0); List filterResultDataList = filterResultDOObj.getFilterResultLst(); int numberOfFilterDataRows = filterResultDataList.size(); //each row iteration for(int row = 0; row < numberOfFilterDataRows; row++) { List filterResultCols = filterResultDataList.get(row); int numberOfFilterDataCols = filterResultCols.size(); //columns iteration of each row for(int col = 0; col < numberOfFilterDataCols ; col++) { String filterColumnsValues = (String) filterResultCols.get(col); table.addCell(filterColumnsValues); } } return table; }//generatePDF }

    Read the article

  • Best way to test for a variable's existence in PHP; isset() is clearly broken

    - by chazomaticus
    From the isset() docs: isset() will return FALSE if testing a variable that has been set to NULL. Basically, isset() doesn't check for whether the variable is set at all, but whether it's set to anything but NULL. Given that, what's the best way to actually check for the existence of a variable? I tried something like: if(isset($v) || @is_null($v)) (the @ is necessary to avoid the warning when $v is not set) but is_null() has a similar problem to isset(): it returns TRUE on unset variables! It also appears that: @($v === NULL) works exactly like @is_null($v), so that's out, too. How are we supposed to reliably check for the existence of a variable in PHP? Edit: there is clearly a difference in PHP between variables that are not set, and variables that are set to NULL: <?php $a = array('b' => NULL); var_dump($a); PHP shows that $a['b'] exists, and has a NULL value. If you add: var_dump(isset($a['b'])); var_dump(isset($a['c'])); you can see the ambiguity I'm talking about with the isset() function. Here's the output of all three of these var_dump()s: array(1) { ["b"]=> NULL } bool(false) bool(false) Further edit: two things. One, a use case. An array being turned into the data of an SQL UPDATE statement, where the array's keys are the table's columns, and the array's values are the values to be applied to each column. Any of the table's columns can hold a NULL value, signified by passing a NULL value in the array. You need a way to differentiate between an array key not existing, and an array's value being set to NULL; that's the difference between not updating the column's value and updating the column's value to NULL. Second, Zoredache's answer, array_key_exists() works correctly, for my above use case and for any global variables: <?php $a = NULL; var_dump(array_key_exists('a', $GLOBALS)); var_dump(array_key_exists('b', $GLOBALS)); outputs: bool(true) bool(false) Since that properly handles just about everywhere I can see there being any ambiguity between variables that don't exist and variables that are set to NULL, I'm calling array_key_exists() the official easiest way in PHP to truly check for the existence of a variable. (Only other case I can think of is for class properties, for which there's property_exists(), which, according to its docs, works similarly to array_key_exists() in that it properly distinguishes between not being set and being set to NULL.)

    Read the article

  • UNIQUE Constraints in SQL (SQL Server)

    - by rockbala
    Why are UNIQUE Constraints needed in database ? Can you provide any examples ? Primary Key is UNIQUE by default... Understandable as they are referred in other tables as Foreign keys... relation is needed to connect them for rdbms platform... but why would one refer to other columns as UNIQUE, what is benefit of doing so ?)

    Read the article

  • Latex: index of symbols

    - by Daniel
    I want to create an index of symbols or notation, similar to the usual index one obtains with makeindex. I have gotten this to work, using the glossaries package. However, just as in the usual index, I would like to get two columns in the index of symbols, while glossaries puts everything under each other. Commands like twocolumn or multicol also do not work, because then the second column starts higher than the first, above the title of the index of symbols. Any suggestions?

    Read the article

  • Add LINQ Auto-Generated Value Marker [Column(IsDbGenerated=true)] in Buddy Class

    - by Alex
    Hello, is it possible to decorate a field of a LINQ generated class with [Column(IsDbGenerated=true)] using a buddy class (which is linked to the LINQ class via [MetadataType(typeof(BuddyMetadata))]) ? My goal is to be able to clear and repopulate the LINQ ORM designer without having to set the "Auto Generate Value" property manually every time to re-establish the fact that certain columns are autogenerated. Thanks!

    Read the article

  • Can I do this in one Mysql query?

    - by bsandrabr
    Hi I have a table with two columns: column A column B 1 2 1 2 2 1 I want to return total of ones = 3 total of twos = 3 The best I can come up with is two queries like so: SELECT sum( CASE WHEN columnA =1 THEN 1 ELSE 0 END ) + sum(CASE WHEN columnB =1 THEN 1 ELSE 0 END ) SELECT sum( CASE WHEN columnA =2 THEN 1 ELSE 0 END ) + sum(CASE WHEN columnB =2 THEN 1 ELSE 0 END ) Can this be done in one query? Thanks

    Read the article

  • CSS ul userlist formatting

    - by Titan
    Hi, I am trying to break away from using tables in my formatting, and am trying out using userlist html tags <ul> Say I have a panel with 10 controls, and I want a 3 columns display, therefore 3 controls in each row, and a total of 4 rows for 10 controls. Should I use 4 different <ul> or should I just stack them inside one <ul> Please tell me the advantages and disadvantages Thanks

    Read the article

  • Database time data retrieval, time based queries

    - by Raphael Pineda
    I am new to time manipulation or time arithmetic operations and am currently developing a navigation system with Web server based information and currently I have this Database that contains a table peek hours whose columns are id, start_time, end_time , edge_id, day_of_the_week, edge_weight ------------------------------------------------------------------------ | Peek Hours | ------------------------------------------------------------------------ | | | | | | | | id | start_time | end_time | edge_id | day_of_the_week | edge_weight | | | | | | | | ------------------------------------------------------------------------ I am using PHP as a webservice and so based on the current time i want to get all the records that would fit this equation start_time< current_time < end_time

    Read the article

  • How to change SRID of geometry column?

    - by Z77
    I have table where the one of columns is geometry column the_geom for polygons with SRID. I added new column in the same table with exactly the same geometry data as in the_geom. This another column has name the_geom4258 because I want here to set up another SRID=4258. So what is the procedure to set up another SRID geometry to be changed (in another coord.system)? Is just enough to apply following query: UPDATE table SET the_geom4258=ST_SetSRID(the_geom4258,4258);

    Read the article

  • row operation in same table and same coloumns

    - by Raj
    Hi! i have a little problem to discuss i hope it will easy for you. suppose i have table A with 2 columns as item price milk 25 milk 50 milk 100 Butter 25 Butter 100 Butter 200 now i want to display a table B derived from table A as item price growth rate milk 0 milk 100 milk 100 Butter 100 Butter 200 Butter 100 formula for growth rate for row1 is ((row[1]-row[0])/row[0])*100 eg for 1st row ((50-25)/25)*100 can you suggest a SQl Query for it

    Read the article

  • How to Update the primary key of table which is referenced as foreign key in another table?

    - by Mobin
    Suppose a Table "Person" having columns "SSN","Name","Address" and another Table "Contacts" having "Contact_ID","Contact_Type","SSN"(primary key of Person) similarly Table "Records" having "Record_ID","Record_Type","SSN"(primary key of Person) Now i want that when i change or update SSN in person table that accordingly changes in other 2 tables. If anyone can help me with a trigger for that Or how to pass foreign key constraints for tables

    Read the article

  • How to bind grid in ASP.NET?

    - by Abid Ali
    I cant bind my Grid. I dont know what I am doing wrong, the grid appears empty when I run the program. here is my code :: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) this.BindGrid(this.GridView1); } private void BindGrid(GridView grid) { SqlCommand cmd = new SqlCommand("Select * from Person", cn); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); grid.DataSource = dt; grid.DataBind(); } <body> <form id="form1" runat="server"> <div style="margin-left: 240px"> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Width="856px" AutoGenerateColumns = "false" ShowFooter = "true" ShowHeader="true" BorderStyle="Groove" CaptionAlign="Top" HorizontalAlign="Center" onrowdatabound="GridView1_RowDataBound" > <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> <Columns> <asp:BoundField HeaderText="ID" /> <asp:BoundField HeaderText="First Name" /> <asp:BoundField HeaderText="Last Name" /> <asp:BoundField HeaderText="Home Phone #" /> <asp:BoundField HeaderText="Cell #" /> <asp:BoundField HeaderText="Email Address" /> <asp:BoundField HeaderText="NIC #" /> <asp:TemplateField HeaderText="Action"> <ItemTemplate> <asp:Button ID="Button1" runat="server" Text="Button" /> <asp:Button ID="Button2" runat="server" Text="Button" /> </ItemTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> <EditRowStyle BackColor="#999999" /> <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> </asp:GridView> </div> </form> </body>

    Read the article

  • Linq - get compare with transliterated value of fields

    - by Maxim
    Hi! I have a table (sql server). One of its columns ('Name') Contains Cyrillic values. From parameters i recieve value, that contains in this field but the are transliterated. i mean something like: var q = from r in m_DataContext.Table where CTransliteration.Transliterate(r.Name).Contains(trans_text) select r; How can i transliterate value on-fly?

    Read the article

< Previous Page | 135 136 137 138 139 140 141 142 143 144 145 146  | Next Page >