Just a question about the " Select " query in mssql

Results 1 to 5 of 5
  1. #1
    Elite Member P0kemonMast is offline
    Member +Rank
    Jun 2012 Join Date
    156Posts

    Just a question about the " Select " query in mssql

    Well its been a while since i used mssql. Last mssql i used was 2005 years ago. SO imma show 1 query example here then imma explain what I need help in.

    Code:
    USE [SRO_VT_SHARD]
    GO
    
    SELECT [Service]
          ,[ID]
          ,[CodeName128]
          ,[ObjName128]
          ,[OrgObjCodeName128]
          ,[NameStrID128]
          ,[DescStrID128]
          ,[CashItem]
          ,[Bionic]
          ,[TypeID1]
          ,[TypeID2]
          ,[TypeID3]
          ,[TypeID4]
          ,[DecayTime]
          ,[Country]
          ,[Rarity]
          ,[CanTrade]
          ,[CanSell]
          ,[CanBuy]
          ,[CanBorrow]
          ,[CanDrop]
          ,[CanPick]
          ,[CanRepair]
          ,[CanRevive]
          ,[CanUse]
          ,[CanThrow]
          ,[Price]
          ,[CostRepair]
          ,[CostRevive]
          ,[CostBorrow]
          ,[KeepingFee]
          ,[SellPrice]
          ,[ReqLevelType1]
          ,[ReqLevel1]
          ,[ReqLevelType2]
          ,[ReqLevel2]
          ,[ReqLevelType3]
          ,[ReqLevel3]
          ,[ReqLevelType4]
          ,[ReqLevel4]
          ,[MaxContain]
          ,[RegionID]
          ,[Dir]
          ,[OffsetX]
          ,[OffsetY]
          ,[OffsetZ]
          ,[Speed1]
          ,[Speed2]
          ,[Scale]
          ,[BCHeight]
          ,[BCRadius]
          ,[EventID]
          ,[AssocFileObj128]
          ,[AssocFileDrop128]
          ,[AssocFileIcon128]
          ,[AssocFile1_128]
          ,[AssocFile2_128]
          ,[Link]
      FROM [dbo].[_RefObjCommon]
    WHERE (CodeName128 = 'ITEM_EU_TSWORD_01_A')
    So I know that query will find me that 1 dg item and show me all details of all its columns.
    BUT , what if i want the query to show me a lot more degrees of the same weapon ?

    In mssql 2005 I think what i did was that I would change the degree of the item and replace it with % . So it would like like this 'ITEM_EU_TSWORD_%_A' . But if I do that , nothing shows up at all.


    I dont know if im doing something wrong. Or I completely forgot. By the way im using mssql 2012 express. So it might have changed. Idk thats why im asking here.


  2. #2
    In the Emperor name Caosfox is offline
    Grand MasterRank
    Jun 2011 Join Date
    Balcora GateLocation
    1,608Posts

    Re: Just a question about the " Select " query in mssql

    try codename128 LIKE , not =

  3. #3
    JavaScript Is Best Script Jash is offline
    Grand MasterRank
    Dec 2010 Join Date
    SingaporeLocation
    683Posts
    Sorry to go off topic, but you can shorten your query a bit. To get all the colum details use :
    "select * from tablename where codename=somethingyouwant"

    Not sure if MSSQL does the same though.

    Sent from my LG-P500 using Tapatalk 2

  4. #4
    Elite Member P0kemonMast is offline
    Member +Rank
    Jun 2012 Join Date
    156Posts

    Re: Just a question about the " Select " query in mssql

    Quote Originally Posted by Caosfox View Post
    try codename128 LIKE , not =
    That did the trick. Thanks. Not sure whats the difference since LIKE , and = gives me same results. Althought % works with LIKE and not =. Oh well it does the trick. Thanks

    Quote Originally Posted by Caosfox View Post
    try codename128 LIKE , not =
    That did the trick. Thanks. Not sure whats the difference since LIKE , and = gives me same results. Althought % works with LIKE and not =. Oh well it does the trick. Thanks

  5. #5
    † Working in Secret † Madelyn is offline
    Grand MasterRank
    Jun 2011 Join Date
    San CristóbalLocation
    658Posts

    Re: Just a question about the " Select " query in mssql

    Quote Originally Posted by P0kemonMast View Post
    That did the trick. Thanks. Not sure whats the difference since LIKE , and = gives me same results. Althought % works with LIKE and not =. Oh well it does the trick. Thanks



    That did the trick. Thanks. Not sure whats the difference since LIKE , and = gives me same results. Althought % works with LIKE and not =. Oh well it does the trick. Thanks
    Like is: Similar.
    = : Exact.



Advertisement