Results 1 to 2 of 2

Thread: Sql help

  1. #1
    Ahmad Ghaffar's Avatar
    Ahmad Ghaffar is offline Senior Member+
    Last Online
    25th June 2020 @ 03:00 PM
    Join Date
    19 Jun 2009
    Location
    K.R.K
    Age
    35
    Gender
    Male
    Posts
    366
    Threads
    113
    Credits
    1,025
    Thanked
    6

    Default Sql help

    janab mujay neechay sql ka code hai aur error bhi hai.. kiya problem hai kay execute nai hota hai.. table tu create ho gaya hai but values insert nai ho rahi hain.

    CREATE TABLE Item_Sale(
    Item varchar(20),
    Description varchar(20),
    Qty int,
    Soled_Date smalldatetime,
    Price_Item int
    );

    /*insert data into item format multiple rows at a time */
    INSERT INTO Item(Item , Description , Qty , Soled_Date , Price_Item )
    SELECT 'Mobile','Nokia 1200','1','2','1/12/2012','2,800'
    UNION ALL
    SELECT 'Laptop','Dual Core 2.0Ghz','3','1/12/2012','12,398'
    UNION ALL
    SELECT 'Mobile-cover','Motroalla','24','1/12/2012','20.00'
    UNION ALL
    SELECT 'Comp-Bag','General','30','2/12/2012','556.00'
    UNION ALL
    SELECT 'Wrist-Watch','Casio','2','2/12/2012','3548.00'
    GO



    ERROR :
    Msg 205, Level 16, State 1, Line 1
    All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

  2. #2
    rizwan_aslam is offline Senior Member+
    Last Online
    31st December 2012 @ 01:53 AM
    Join Date
    14 May 2012
    Age
    37
    Gender
    Male
    Posts
    49
    Threads
    9
    Credits
    0
    Thanked
    0

    Default

    sql ka kon sa version use kr ray ho?

Similar Threads

  1. Set Compatibility Level for SQL Server 2008 or 2005 Database
    By UltimateX in forum English IT Zone
    Replies: 4
    Last Post: 13th April 2020, 04:41 AM
  2. SqL Kiya hota hAi LearN
    By Rau7* in forum English IT Zone
    Replies: 7
    Last Post: 18th December 2014, 05:31 PM
  3. MCP Exam Number
    By JohnnyG in forum Ask an Expert
    Replies: 3
    Last Post: 30th November 2010, 02:48 PM
  4. sql server and sql server agent stopped.
    By khattak06 in forum Ask an Expert
    Replies: 6
    Last Post: 16th July 2009, 12:44 PM
  5. SQL Functions Programmer’s Reference
    By oralover2006 in forum English IT Zone
    Replies: 2
    Last Post: 28th May 2009, 10:59 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •